A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/gulpjs/gulp/issues/91 below:

Monkey patching `pipe` method from gulp.src · Issue #91 · gulpjs/gulp · GitHub

In continue from this issue and summed up thoughts about error handling in gulp here is possible solution. Monkey patch pipe method from gulp.src in such a way, that it will monkey patch other streams, when you call pipe on them. This will allow fix pipe behaviour, that unpipes destanation stream on error.

Here is proposed options to gulp.src:

unpipeOnError [Boolean]
Don't remove ondata listener in destination stream on error. This option inherits on all streams in pipeline.

logOnError: [Boolean, String]
Little helper, that cleans up copy-pasted on('error', gutil.log) code. It will log errors that prefixed by passed string.

Example of usage:

gulp.src('coffee/**/*.coffee', { unpipeOnError: false, logOnError: true })
  .pipe(gulpPrefixer('// Copyright 2014 (C) Aswesome company'))
  .pipe(coffee())
  .pipe(gulp.dest('js/'));

Also it will be nice to have unpipeOnError option inside a pipe function to allow partially soft pipelines:

gulp.src('coffee/**/*.coffee', { logOnError: true })
  .pipe(gulpPrefixer('// Copyright 2014 (C) Aswesome company'))
  .pipe(coffee(), { unpipeOnError: false })
  .pipe(gulp.dest('js/'));

marcoms, armujahid and DRSDavidSoft


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4