Skip to content

Commit d899e4a

Browse files
Narretzpetebacondarwin
authored andcommitted
chore(*): use binaries from node_modules/.bin
Closes angular#15071
1 parent 9ee0c48 commit d899e4a

File tree

5 files changed

+69
-7
lines changed

5 files changed

+69
-7
lines changed

lib/grunt/plugins.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ module.exports = function(grunt) {
3939

4040

4141
grunt.registerTask('docs', 'create angular docs', function() {
42-
var gruntProc = shelljs.exec('node "' + require.resolve('gulp/bin/gulp') + '" --gulpfile docs/gulpfile.js');
42+
var gruntProc = shelljs.exec('npm run gulp -- --gulpfile docs/gulpfile.js');
4343
if (gruntProc.code !== 0) {
4444
throw new Error('doc generation failed');
4545
}

lib/grunt/utils.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
var fs = require('fs');
44
var shell = require('shelljs');
55
var grunt = require('grunt');
6-
var spawn = require('child_process').spawn;
6+
var spawn = require('cross-spawn');
77

88
var CSP_CSS_HEADER = '/* Include this file in your html if you are using the CSP mode. */\n\n';
99

@@ -15,7 +15,7 @@ module.exports = {
1515
var reporters = grunt.option('reporters');
1616
var noColor = grunt.option('no-colors');
1717
var port = grunt.option('port');
18-
var p = spawn('node', [require.resolve('karma/bin/karma'), 'start', config,
18+
var p = spawn('./node_modules/.bin/karma', ['start', config,
1919
singleRun ? '--single-run=true' : '',
2020
reporters ? '--reporters=' + reporters : '',
2121
browsers ? '--browsers=' + browsers : '',
@@ -38,7 +38,7 @@ module.exports = {
3838
done();
3939
return;
4040
}
41-
var p = spawn('node', [require.resolve('protractor/bin/webdriver-manager'), 'update']);
41+
var p = spawn('./node_modules/.bin/webdriver-manager', ['update']);
4242
p.stdout.pipe(process.stdout);
4343
p.stderr.pipe(process.stderr);
4444
p.on('exit', function(code) {
@@ -54,7 +54,7 @@ module.exports = {
5454
var sauceBuild = grunt.option('capabilities.build');
5555
var browser = grunt.option('browser');
5656
var specs = grunt.option('specs');
57-
var args = [require.resolve('protractor/bin/protractor'), config];
57+
var args = [config];
5858
if (sauceUser) args.push('--sauceUser=' + sauceUser);
5959
if (sauceKey) args.push('--sauceKey=' + sauceKey);
6060
if (tunnelIdentifier) args.push('--capabilities.tunnel-identifier=' + tunnelIdentifier);
@@ -65,7 +65,7 @@ module.exports = {
6565
}
6666

6767

68-
var p = spawn('node', args);
68+
var p = spawn('./node_modules/.bin/protractor', args);
6969
p.stdout.pipe(process.stdout);
7070
p.stderr.pipe(process.stderr);
7171
p.on('exit', function(code) {

npm-shrinkwrap.clean.json

+24
Original file line numberDiff line numberDiff line change
@@ -2630,6 +2630,30 @@
26302630
}
26312631
}
26322632
},
2633+
"cross-spawn": {
2634+
"version": "4.0.0",
2635+
"dependencies": {
2636+
"lru-cache": {
2637+
"version": "4.0.1",
2638+
"dependencies": {
2639+
"pseudomap": {
2640+
"version": "1.0.2"
2641+
},
2642+
"yallist": {
2643+
"version": "2.0.0"
2644+
}
2645+
}
2646+
},
2647+
"which": {
2648+
"version": "1.2.10",
2649+
"dependencies": {
2650+
"isexe": {
2651+
"version": "1.1.2"
2652+
}
2653+
}
2654+
}
2655+
}
2656+
},
26332657
"cz-conventional-changelog": {
26342658
"version": "1.1.4",
26352659
"dependencies": {

npm-shrinkwrap.json

+36
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
"postinstall": "node scripts/npm/copy-npm-shrinkwrap.js",
1818
"commit": "git-cz",
1919
"test-i18n": "jasmine-node i18n/spec",
20-
"test-i18n-ucd": "jasmine-node i18n/ucd/spec"
20+
"test-i18n-ucd": "jasmine-node i18n/ucd/spec",
21+
"gulp": "gulp"
2122
},
2223
"devDependencies": {
2324
"angular-benchpress": "0.x.x",
@@ -27,6 +28,7 @@
2728
"canonical-path": "0.0.2",
2829
"cheerio": "^0.17.0",
2930
"commitizen": "^2.3.0",
31+
"cross-spawn": "^4.0.0",
3032
"cz-conventional-changelog": "1.1.4",
3133
"dgeni": "^0.4.0",
3234
"dgeni-packages": "^0.14.0",

0 commit comments

Comments
 (0)