Skip to content

Commit

Permalink
Merge pull request #2192 from leedm777/fix-grunt-launching
Browse files Browse the repository at this point in the history
Fix grunt launching when it's a peer dep
  • Loading branch information
Loïc Saint-Roch committed Sep 12, 2014
2 parents f700dc9 + a267276 commit df0cafb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions lib/hooks/grunt/grunt-wrapper.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* A hack to exec grunt without knowing exactly where it is.
*
* grunt-cli could be installed as a peer to sails, so we don't know
* where its bin script might be. But require can find it. We have this thin
* wrapper to be a script we can exec, and it will execute the grunt-cli,
* wherever it may be installed.
*/

require('grunt-cli/bin/grunt');
2 changes: 1 addition & 1 deletion lib/hooks/grunt/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ module.exports = function (sails) {
var child = ChildProcess.fork(

// cwd for child process
path.join(pathToSails,'node_modules/grunt-cli/bin/grunt'),
path.join(__dirname, 'grunt-wrapper.js'),

// cmd args+opts for child process
[
Expand Down

0 comments on commit df0cafb

Please sign in to comment.