fix STDIN handling of CLI (#956)
authorDamien Dart <damiendart@pobox.com>
Thu, 23 Aug 2018 07:20:13 +0000 (08:20 +0100)
committerAlex Lam S.L <alexlamsl@gmail.com>
Thu, 23 Aug 2018 07:20:13 +0000 (15:20 +0800)
Fix a bug where input from STDIN is ignored even if no input files are specified on the command line.

cli.js

diff --git a/cli.js b/cli.js
index 2ec6102..dd69fa5 100755 (executable)
--- a/cli.js
+++ b/cli.js
@@ -297,7 +297,7 @@ if (inputDir || outputDir) {
   processDirectory(inputDir, outputDir, fileExt);
 }
 // Minifying one or more files specified on the CMD line
-else if (typeof content === 'string') {
+else if (content) {
   writeMinify();
 }
 // Minifying input coming from STDIN