From c378c98cf68a85cd87ccf1690cb680dec4e246d4 Mon Sep 17 00:00:00 2001 From: Jakob Krigovsky Date: Sat, 31 Jan 2015 14:55:35 +0100 Subject: [PATCH] Use exit on Windows to ensure stdio is flushed See https://github.com/joyent/node/issues/3584. --- src/cli/argv.coffee | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/cli/argv.coffee b/src/cli/argv.coffee index 72e3f8d..faf7e72 100644 --- a/src/cli/argv.coffee +++ b/src/cli/argv.coffee @@ -52,6 +52,12 @@ module.exports = (argv) -> , (err) -> if err console.error err - process.exit 1 + exit 1 else - process.exit exitCode + exit exitCode + +exit = (code = 0) -> + if process.platform is 'win32' + require('exit') code + else + process.exit code