0

Update - The more I dig into this... the more I think it has to do with node.

I using gulp-newer and gulp-notify, which includes node-notifier. When I run a tasks that doesn't produce any new files, because newer doesn't see any changes and jumps out of the task. I would like to have a notification saying Done - no new files. All it does now is end without notification.

Quick code Example:

gulp.task('copy', function(){
        return gulp.src('/app')
            .pipe(newer('/dist')) 
           - insert code to notify if all the files are the same or if stream ends before next pipe...
            .pipe(gulp.dest('/dist'))
            .pipe(notify({message: 'Copy task done', onLast: true}));
    });

Here is an example of code I've tried -

.pipe($.newer(path.distBase).on('end',function(){ $.nodeNotifier.notify({message:'No Files'})}))

The issue being that newer always ends. I need to know if the stream ends or continues on, I think.

RooksStrife
  • 1,647
  • 3
  • 22
  • 54
  • Could you show us your `path` configuration object? – The Reason Jan 29 '16 at 17:02
  • @The Changed it to a string. It's shouldn't matter for the question though, unless I am missing something. – RooksStrife Jan 29 '16 at 18:03
  • you can try `.on('end', console.log.bind(console))` after piping into `newer` to check if the stream ever reports it is over (used to be an issue with some lesser used gulp plugins) or use `gulp-debug` to display what files are left in the stream. – Leon Adler Jan 29 '16 at 18:28
  • @The you wrote `gulp-notifier`, but linked to `gulp-notify`, which the OP mentions in the first paragraph of the question. – Leon Adler Jan 29 '16 at 18:30
  • @LeonAdler I tried what you suggested and something similar with finish, but it always seems to fire. I am also, trying to get a notification. – RooksStrife Jan 29 '16 at 18:47
  • @LeonAdler Updated the question with an example I've tried. – RooksStrife Jan 29 '16 at 18:55

0 Answers0