Skip to content

Instantly share code, notes, and snippets.

@lazd
Created December 14, 2013 01:11
Show Gist options
  • Save lazd/7954369 to your computer and use it in GitHub Desktop.
Save lazd/7954369 to your computer and use it in GitHub Desktop.
es.through undefined file
var gulp = require('gulp');
var es = require('event-stream');
function plugalug() {
function queue(file) {
if (typeof file === 'undefined') {
throw new Error('File was undefined!');
}
}
function end() {
console.log('Stream ended');
}
return es.through(queue, end);
}
gulp.task('test-watch', function() {
return gulp.src('gulpfile.js')
.pipe(plugalug());
})
gulp.task('default', function() {
gulp.watch('gulpfile.js', function(event) {
gulp.run('test-watch')
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment