Permalink
Browse files

Revert "Merge pull request #749 from Bonuspunkt/master"

This reverts commit 815dae1, reversing
changes made to 0f116f6.
  • Loading branch information...
1 parent d448df7 commit cf711204dfb5a6775da4dd5654c52d03712efa43 @valueof valueof committed Jan 2, 2013
Showing with 14 additions and 6 deletions.
  1. +14 −6 src/cli/cli.js
View
@@ -378,12 +378,20 @@ var exports = {
verbose: options.verbose
});
- var exiting = false;
- process.on('exit', function() {
- if (exiting) { return; }
- exiting = true;
- process.exit(passed ? 0 : 2);
- });
+ // Avoid stdout cutoff in Node 0.4.x, also supports 0.5.x.
+ // See https://github.com/joyent/node/issues/1669
+
+ function exit() { process.exit(passed ? 0 : 2); }
+
+ try {
+ if (!process.stdout.flush()) {
+ process.stdout.once("drain", exit);
+ } else {
+ exit();
+ }
+ } catch (err) {
+ exit();
+ }
}
};

0 comments on commit cf71120

Please sign in to comment.