Skip to content

Commit

Permalink
[v0.6] Handle stdout suppressing correctly
Browse files Browse the repository at this point in the history
In node v0.5.x `process.stdout` is a getter, so assigning to it makes
no difference (see nodejs/node-v0.x-archive#1878 - thanks @bnoordhuis).
  • Loading branch information
mmalecki committed Oct 13, 2011
1 parent 87462e6 commit 006476f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions bin/vows
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,11 @@ while (arg = argv.shift()) {
}

if (options.supressStdout) {
_reporter.setStream && _reporter.setStream(process.stdout);
process.stdout = fs.createWriteStream('/dev/null');
_reporter.setStream && _reporter.setStream(process.stdout);
var devNullStream = fs.createWriteStream('/dev/null');
process.__defineGetter__('stdout', function () {
return devNullStream;
});
}

if (options.watch) {
Expand Down

0 comments on commit 006476f

Please sign in to comment.