Skip to content

Commit a8314b8

Browse files
xanfindexzero
authored andcommitted
Delay process.exit for proper drain of streams on node 0.10
1 parent 01590ff commit a8314b8

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

bin/vows

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -306,13 +306,11 @@ if (! options.watch) {
306306
} catch (err) {
307307
// ignore the undefined jscoverage
308308
}
309-
if (process.stdout.write('')) { // Check if stdout is drained
310-
process.exit(status);
311-
} else {
312-
process.stdout.on('drain', function () {
309+
process.on('exit', function (code) {
310+
if (code === 0) {
313311
process.exit(status);
314-
});
315-
}
312+
}
313+
});
316314
});
317315
} else {
318316
//

0 commit comments

Comments
 (0)