Skip to content
This repository was archived by the owner on Sep 19, 2025. It is now read-only.

Commit 6fc9f84

Browse files
Merge pull request #32 from ChadKillingsworth/output-before-exit
Write out standard error before exiting on errors
2 parents d6fd486 + e019b7f commit 6fc9f84

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/gulp/index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,16 +150,17 @@ module.exports = function(initOptions) {
150150
})
151151
]).then((function(results) {
152152
var code = results[0];
153-
// non-zero exit means a compilation error
154-
if (code !== 0) {
155-
this.emit('error', new PluginError(this.PLUGIN_NAME_, 'Compilation error'));
156-
}
157153

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

159+
// non-zero exit means a compilation error
160+
if (code !== 0) {
161+
this.emit('error', new PluginError(this.PLUGIN_NAME_, 'Compilation error'));
162+
}
163+
163164
// If present, standard output will be a string of JSON encoded files.
164165
// Convert these back to vinyl
165166
if (stdOutData.trim().length > 0) {

0 commit comments

Comments
 (0)