From 352fe782be2d5d3aa8c751a187fdc98ff457948f Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Wed, 11 May 2016 13:53:33 +0200 Subject: [PATCH] Call resume on the stream to emit events Fixes #47 --- README.md | 7 +++++-- index.js | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e093e07..094745b 100644 --- a/README.md +++ b/README.md @@ -144,9 +144,12 @@ gulp.task('lint', function(cb) { gulp.src('lib/*.css') .pipe(csslint()) - .pipe(csslint.reporter('junit-xml', {logger: function(str) { output += str; }})); + .pipe(csslint.reporter('junit-xml', {logger: function(str) { output += str; }})) + .on('end', function(err) { + if (err) return cb(err); - fs.writeFile('some/path/junit.xml', output, cb); + fs.writeFile('some/path/junit.xml', output, cb); + }); }); ``` diff --git a/index.js b/index.js index eee348a..eb50c02 100644 --- a/index.js +++ b/index.js @@ -127,7 +127,7 @@ cssLintPlugin.reporter = function(customReporter, options) { return cb(); } - ); + ).resume(); // Force flow-mode https://nodejs.org/docs/latest/api/stream.html#stream_event_end }; cssLintPlugin.addRule = function(rule) {