Skip to content

Commit

Permalink
Use locally installed gulp to run tasks.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmm committed Jan 4, 2017
1 parent b271168 commit f431571
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 || {};
Expand Down Expand Up @@ -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] });
}
}

Expand Down

0 comments on commit f431571

Please sign in to comment.