I am trying to make sure that if the -theme flag is not specified, it stops the gulp task and wonders how best to do this in a dry way.
I would like each individual task to stop if the -theme option is not specified, and also stop the default task if it is not completed.
I tried a few things with no luck.
Thanks,
gulp.task('test', function() { if(typeof(args.theme) == 'undefined' || args.theme === true) { console.log(msg.noTheme); return; // end task } // run rest of task... }); gulp.task('test-2', function() { if(typeof(args.theme) == 'undefined' || args.theme === true) { console.log(msg.noTheme); return; // end task } // run rest of task... }); gulp.task('default', ['test-1', 'test-2']);
Ross
source share