Skip to content

Commit

Permalink
Merge pull request #32 from ChadKillingsworth/output-before-exit
Browse files Browse the repository at this point in the history
Write out standard error before exiting on errors
  • Loading branch information
ChadKillingsworth authored Aug 24, 2016
2 parents d6fd486 + e019b7f commit 6fc9f84
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/gulp/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,16 +150,17 @@ module.exports = function(initOptions) {
})
]).then((function(results) {
var code = results[0];
// non-zero exit means a compilation error
if (code !== 0) {
this.emit('error', new PluginError(this.PLUGIN_NAME_, 'Compilation error'));
}

// standard error will contain compilation warnings, log those
if (stdErrData.trim().length > 0) {
logger(gutil.colors.yellow(this.PLUGIN_NAME_) + ': ' + stdErrData);
}

// non-zero exit means a compilation error
if (code !== 0) {
this.emit('error', new PluginError(this.PLUGIN_NAME_, 'Compilation error'));
}

// If present, standard output will be a string of JSON encoded files.
// Convert these back to vinyl
if (stdOutData.trim().length > 0) {
Expand Down

0 comments on commit 6fc9f84

Please sign in to comment.