/bin/pegjs: Don't close standard output

Avoids "Error: process.stdout cannot be closed" error when invoked
without file arguments.
This commit is contained in:
David Majda 2012-02-12 19:10:30 +01:00
parent 70e4166bb2
commit de256105eb

View file

@ -138,5 +138,7 @@ readStream(inputStream, function(input) {
}
outputStream.write(exportVar + " = " + parser.toSource() + ";\n");
outputStream.end();
if (outputStream !== process.stdout) {
outputStream.end();
}
});