jmdesigner81 jmdesigner81 - 1 year ago 131
Node.js Question

gulp.series() doesn't run tasks

I can't figure out why

is not firing in my callback function.

I'm trying to grab a string from a user input with
and invoke a build and deployment function with
. My tasks within
don't fire at all.

gulp.task('test', function(){
const prompt = require('gulp-prompt');
return gulp.src('test.js')
type: 'checkbox',
name: 'env',
message: 'which environment do you want to deploy to?',
choices: ['qa','prod']
var env = res.env;
gulp.series('clean', 'patternlab:build', 'tag-version', deployWeb.bind(this, env), function(done){

Answer Source

Calling gulp.series('task1', 'task2') does not run task1 and task2. All it does is return a new function. Only once you call that function are the tasks actually executed.

That means in your case you need to do the following:

var runTasks = gulp.series('clean', 'patternlab:build',
                           'tag-version', deployWeb.bind(this, env));

The whole function(done){ done(); } part that you had in your code doesn't really make much sense and isn't needed for gulp.series().

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download