diff --git a/index.js b/index.js index 78341e5..edcf2cc 100644 --- a/index.js +++ b/index.js @@ -31,7 +31,7 @@ GulpRunner.prototype.run = function(tasks, options, cb) { options.gulpfile = this.gulpfile; tasks = util.isArray(tasks) ? tasks : [tasks]; - var gulpBin = require.resolve('gulp/bin/gulp.js') + var gulpBin = options.gulpBin || require.resolve('gulp/bin/gulp.js') var gulpOpts = [gulpBin].concat(buildOpts(tasks, options)) var gulp = child.spawn(process.execPath, gulpOpts, { detached: true, diff --git a/readme.md b/readme.md index 5af5423..106a432 100644 --- a/readme.md +++ b/readme.md @@ -23,6 +23,7 @@ gulp.run('task', function(err) { ``` /* optional cli arguments (camelcased) */ var opts = { + gulpBin: 'path/to/proper/gulp.js', // use when multiple versions of gulp-cli is installed in subprojects require: ['coffeescript', 'some-lib'], tasksSimple: true, production: true // also accepts arbitrary flags @@ -64,4 +65,4 @@ gulp.on('error', function(err: Buffer) { }) gulp.run('default') -``` \ No newline at end of file +```