diff --git a/tasks/npm-install.js b/tasks/npm-install.js index 3bb20d4..a2056aa 100644 --- a/tasks/npm-install.js +++ b/tasks/npm-install.js @@ -15,6 +15,10 @@ module.exports = function(grunt) { var modules = Array.prototype.slice.call(arguments); var done = this.async(); + var options = this.options({ + cwd: '' + }); + function errorHandler(err) { if (err) { grunt.log.error(err); @@ -28,6 +32,10 @@ module.exports = function(grunt) { return; } + if (options.cwd) { + npm.prefix = options.cwd; + } + npm.commands.install(modules, errorHandler); }); });