Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Calling gulp-notify without using .pipe()

In my gulpfile.js I have a task that calls two other tasks. 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.

like image 405
tobi-or-not Avatar asked Nov 06 '14 14:11

tobi-or-not


1 Answers

You can use node-notifier directly:

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

gulp.task('build', ['build:js', 'build:css'], function() {
    notifier.notify({ title: 'Production Build', message: 'Done' });
});
like image 124
Heikki Avatar answered Oct 22 '22 12:10

Heikki