From 2467e343c3d236620b8c7c9f3c8344c1cae39e09 Mon Sep 17 00:00:00 2001 From: Jacek Drobiecki Date: Tue, 30 Oct 2018 14:45:21 +0100 Subject: [PATCH] Added options.gulpBin --- index.js | 2 +- readme.md | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) 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 +```