How to get root task name when gulp started

Viewed 429

I'm using gulp and want to print out and highlight root task name, that has been passed right from process arguments.

gulp sometaskname

This solution with wrapping gulp constructor gives me task name for each invoked task.

var runTask = Gulp.Gulp.prototype._runTask;
Gulp.Gulp.prototype._runTask = function(task) {
    GUtil.log(`Project task ${task.name} has started`);
    return runTask.call(this, task);
}

How do I get or detect the root one? Maybe from process.argv?

0 Answers
Related