From de256105eb62237f0ec1c2d104a3ab12c04b16cf Mon Sep 17 00:00:00 2001 From: David Majda Date: Sun, 12 Feb 2012 19:10:30 +0100 Subject: [PATCH] /bin/pegjs: Don't close standard output Avoids "Error: process.stdout cannot be closed" error when invoked without file arguments. --- bin/pegjs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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(); + } });