Fixed output method under node 0.6 which incorrectly tried to close process.stdout.
authorJakub Pawlowicz <jakub@goalsmashers.com>
Tue, 17 Jan 2012 20:05:18 +0000 (21:05 +0100)
committerJakub Pawlowicz <jakub@goalsmashers.com>
Tue, 17 Jan 2012 20:06:36 +0000 (21:06 +0100)
bin/cleancss

index 5130fc6..e149a2b 100755 (executable)
@@ -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();
 };