如何增加吞吐任务的堆栈跟踪?

$ gulp patch [17:13:27] Requiring external module coffee-script/register [17:13:28] Using gulpfile ~/source/sem-campaign.js/gulpfile.coffee [17:13:28] Starting 'bump'... [17:13:28] Starting 'add'... [17:13:28] Bumped version to: 1.0.2 [17:13:28] Bumped version to: 1.0.2 [17:13:28] Finished 'bump' after 31 ms [17:13:28] [17:13:28] Finished 'add' after 30 ms [17:13:28] Starting 'commit'... [?] enter a commit msg, eg initial commit: initial commit [17:13:32] Finished 'commit' after 3.26 s [17:13:32] Starting 'patch'... no buddy [17:13:32] Finished 'patch' after 25 μs events.js:72 throw er; // Unhandled 'error' event ^ Error: Command failed: at ChildProcess.exithandler (child_process.js:648:15) at ChildProcess.emit (events.js:98:17) at maybeClose (child_process.js:756:16) at Socket.<anonymous> (child_process.js:969:11) at Socket.emit (events.js:95:17) 

我很难分辨我的失误的原因,为什么。 我怎样才能增加默认的堆栈跟踪?

添加评论和pipe道工:

  1. 添加这个帮手方法:

    log =(msg) – > console.log msg#你将要接收乙烯基文件作为块transform =(file,cb) – >#读取和修改文件内容#file.contents = new Buffer(String(file.contents )+“一些修改的内容”);

     # if there was some error, just pass as the first parameter here cb(null, file); 

    #返回地图将导致你的变换函数被调用#为每个你收到的块(文件)。 当这个stream#收到一个“结束”信号,它也将结束。 ##此外,你想要在其他地方的event-stream 。 返回eventStream.map(transform);

  2. pipe道任务中的步骤之间的日志方法:

    gulp.task'myTask', – > gulp.src myCss,base:myBase .pipe log“got css files!” .pipe concat'app.css'.pipe log“concatenated css !!”

这是用coffeescript写的,你可以在这里把它变成javascript: http ://js2coffee.org/

  1. 创build一个catch错误的帮助器方法:

    catchError =(err) – > plugins.util.beep()# ref ; console.log错误

  2. 加水pipe工插件:

    gulp.task'myTask', – > gulp.src myCss,base:myBase .pipe plugins.plumber errorHandler:catchError .pipe log“得到了css文件!” .pipe concat'app.css'.pipe log“concatenated css !!”

完成! 🙂

更多的资源来检查: gulp-print gulp-debug