From 655c90b6d4594a86a8bc2990ba2570bb75eb54aa Mon Sep 17 00:00:00 2001 From: Jakub Pawlowicz Date: Tue, 17 Jan 2012 21:05:18 +0100 Subject: [PATCH] Fixed output method under node 0.6 which incorrectly tried to close process.stdout. --- bin/cleancss | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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(); }; -- 2.34.1