diff --git a/bin/pegjs b/bin/pegjs index 08ca376..8c2048b 100755 --- a/bin/pegjs +++ b/bin/pegjs @@ -138,5 +138,7 @@ readStream(inputStream, function(input) { } outputStream.write(exportVar + " = " + parser.toSource() + ";\n"); - outputStream.end(); + if (outputStream !== process.stdout) { + outputStream.end(); + } });