How to get task name inside task in gulp

后端 未结 4 1960
陌清茗
陌清茗 2021-02-12 09:58

I\'m using gulp-plumber + gulp-notify and want to put task name in gulp-notify as a title. following is the code i wrote, thanks in advance.

gulp.task(\'SOMETASK         


        
4条回答
  •  情书的邮戳
    2021-02-12 10:44

    let aCallerName = (new Error().stack.match(/ at [^(]+ /g)).map(s => s.replace(/(?: at | )/g,''));
    console.log( aCallerName ); 
    

    maybe aCallerName[0] or aCallerName[1]....

提交回复
热议问题