From f43157171d11aca0193891591efab46fd2bc22c3 Mon Sep 17 00:00:00 2001 From: David Matthew Mattli Date: Wed, 4 Jan 2017 15:40:10 -0600 Subject: [PATCH] Use locally installed gulp to run tasks. --- index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 03723da..c77b445 100644 --- a/index.js +++ b/index.js @@ -5,6 +5,7 @@ var nodemon , gulp = require('gulp') , cp = require('child_process') , bus = require('nodemon/lib/utils/bus') + , path = require('path') module.exports = function (options) { options = options || {}; @@ -89,7 +90,9 @@ module.exports = function (options) { if (typeof tasks === 'string') tasks = [tasks] if (tasks.length === 0) return if (!(tasks instanceof Array)) throw new Error('Expected task name or array but found: ' + tasks) - cp.spawnSync(process.platform === 'win32' ? 'gulp.cmd' : 'gulp', tasks, { stdio: [0, 1, 2] }) + var gulpPath = path.join(process.cwd(), 'node_modules/.bin/') + var gulpCmd = path.join(gulpPath, process.platform === 'win32' ? 'gulp.cmd' : 'gulp') + cp.spawnSync(gulpCmd, tasks, { stdio: [0, 1, 2] }); } }