-
Notifications
You must be signed in to change notification settings - Fork 27.4k
chore(npm): use require.resolve when possible to avoid hard coded mod… #15071
Conversation
We found a Contributor License Agreement for you (the sender of this pull request) and all commit authors, but as best as we can tell these commits were authored by someone else. If that's the case, please add them to this pull request and have them confirm that they're okay with these commits being contributed to Google. If we're mistaken and you did author these commits, just reply here to confirm. |
1 similar comment
We found a Contributor License Agreement for you (the sender of this pull request) and all commit authors, but as best as we can tell these commits were authored by someone else. If that's the case, please add them to this pull request and have them confirm that they're okay with these commits being contributed to Google. If we're mistaken and you did author these commits, just reply here to confirm. |
@@ -39,7 +39,7 @@ module.exports = function(grunt) { | |||
|
|||
|
|||
grunt.registerTask('docs', 'create angular docs', function() { | |||
var gruntProc = shelljs.exec('"node_modules/.bin/gulp" --gulpfile docs/gulpfile.js'); | |||
var gruntProc = shelljs.exec('node "' + require.resolve('gulp/bin/gulp') + '" --gulpfile docs/gulpfile.js'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to add node
here, otherwise Windows wouldn't execute the command
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather not depend on the internal gulp
package structure. How about creating the npm script gulp
in package.json:
{
"scripts": {
"gulp": "gulp
}
}
and then npm run gulp -- --gulpfile docs/gulpfile.js
should work everywhere.
@mgol I've updated the PR with your suggestions, can you take a look? |
LGTM. |
Cleaned up and rebased version of #13320.
I've tested the affected commands locally, and they all went through.