31
votes

I have a node script and I want to run a gulp task I have in the same script, how can I call it?

#!/usr/bin/env node
var gulp = require('gulp');
gulp.task('default', function (arg) {

});

// How do I call the task 'default'
2

2 Answers

50
votes

Eventually I found the way:

gulp.start('default');
4
votes

Use an array in start method, in the case someone is looking for a way of running multiple tasks from search engines.

gulp.start( [ 'task1', 'task2' ] );