Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit 6b44ffc

Browse files
Splaktarandrewseguin
authored andcommitted
Fix build contributors (#11059)
* docs(contributors): support building contributor list on Windows remove unused docs/app/contributors.json remove redundant and confusing build:contributors npm script the gulp task takes care of this Relates to #10867. * docs(contributors): support building contributor list on macOS/Linux Fixes #10867.
1 parent 43474a1 commit 6b44ffc

File tree

4 files changed

+371
-476
lines changed

4 files changed

+371
-476
lines changed

docs/app/contributors.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

gulp/tasks/build-contributors.js

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,29 @@
33

44
var colors = require('colors');
55
var child_process = require('child_process');
6-
6+
var os = require('os');
77

88
/**
9-
* Note 'githubcontrib' may require a application-scoped access token: GITHUB_API_TOKEN
9+
* Note 'githubcontrib' may require an application-scoped access token defined as
10+
* GITHUB_API_TOKEN in your ENV.
1011
*/
1112
exports.task = function () {
1213
var appPath = 'dist/docs';
1314

14-
exec([
15-
'rm -f '+ appPath + '/contributors.json',
16-
'githubcontrib --owner=angular --repository=material --cols=6 --format=json --showlogin=true --sortBy=login --sha=master > ' + appPath + '/contributors.json'
15+
child_process.execSync('rm -f ' + appPath + '/contributors.json');
16+
17+
if (os.platform() === 'win32') {
18+
process.chdir('./node_modules/.bin');
19+
child_process.execSync('githubcontrib.cmd --owner angular --repo material --cols 6' +
20+
' --format json --showlogin true --sha master --sortOrder desc > '
21+
+ '../../' + appPath + '/contributors.json');
22+
process.chdir('../..');
23+
} else {
24+
exec([
25+
'./node_modules/.bin/githubcontrib --owner angular --repo material --cols 6 --format json' +
26+
' --showlogin true --sha master --sortOrder desc > ' + appPath + '/contributors.json'
1727
]);
28+
}
1829
};
1930
exports.dependencies = ['docs-js'];
2031

0 commit comments

Comments
 (0)