简体   繁体   English

不使用.pipe()调用gulp-notify

[英]Calling gulp-notify without using .pipe()

In my gulpfile.js I have a task that calls two other tasks. 在我的gulpfile.js我有一个调用另外两个任务的任务。 When the previous tasks have run, a notification should be triggered. 运行先前的任务时,应触发通知。

var notify = require('gulp-notify');

gulp.task('build', ['build:js', 'build:css'], function() {
  console.log('hello', arguments);
  gulp.src('gulpfile.js').pipe( notify({ title: 'Production Build', message: 'Done' }) );
});

Is there a way to trigger notify without calling gulp.src('gulpfile.js').pipe( first? While not a real problem, this approach feels unnecessary to me. It is entirely possible that my question results from an insufficient understanding of gulp. So feel free to point me to any misunderstanding. 有没有办法在不调用gulp.src('gulpfile.js').pipe(情况下触发通知gulp.src('gulpfile.js').pipe(首先?虽然不是真正的问题,但这种方法对我来说是不必要的。完全有可能我的问题是由于对gulp。所以请随意指出任何误解。

You can use node-notifier directly: 您可以直接使用node-notifier

var notifier = require('node-notifier');

gulp.task('build', ['build:js', 'build:css'], function() {
    notifier.notify({ title: 'Production Build', message: 'Done' });
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM