From: Jakub Pawlowicz Date: Tue, 17 Jan 2012 20:05:18 +0000 (+0100) Subject: Fixed output method under node 0.6 which incorrectly tried to close process.stdout. X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=655c90b6d4594a86a8bc2990ba2570bb75eb54aa;p=clean-css.git Fixed output method under node 0.6 which incorrectly tried to close process.stdout. --- diff --git a/bin/cleancss b/bin/cleancss index 5130fc6c..e149a2b1 100755 --- a/bin/cleancss +++ b/bin/cleancss @@ -32,13 +32,11 @@ if (options.source) { } function output(cleaned) { - var out; if (options.target) { - out = fs.createWriteStream(options.target, { flags: 'w', encoding: 'utf-8', mode: 0644 }); + var out = fs.createWriteStream(options.target, { flags: 'w', encoding: 'utf-8', mode: 0644 }); + out.write(cleaned); + out.end(); } else { - out = process.stdout; + process.stdout.write(cleaned); } - - out.write(cleaned); - out.end(); };