From 80298b8a7ff50729bfc37a010a90cc8594ce7b05 Mon Sep 17 00:00:00 2001 From: Kristjan Broder Lund Date: Wed, 14 Jan 2015 15:24:14 +0000 Subject: [PATCH] Allow for options.cwd --- tasks/npm-install.js | 8 ++++++++ 1 file changed, 8 insertions(+) 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); }); });