From 27f592a35690aa74884c8ff50e3f2ad2cc33e08d Mon Sep 17 00:00:00 2001 From: Alex Nicksay Date: Tue, 6 Oct 2015 17:30:10 -0400 Subject: [PATCH] Prevent output from being cut off in Node 4 This is a quick fix for truncated output in Node 4 by only calling `process.exit` for errors. Closes #1070 --- cli.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cli.js b/cli.js index 494b2199..3d866f57 100644 --- a/cli.js +++ b/cli.js @@ -447,11 +447,12 @@ cli.generateDocs = function() { // TODO: docs cli.exit = function(exitCode, message) { - if (message && exitCode > 0) { - console.error(message); + if (exitCode > 0) { + if (message) { + console.error(message); + } + process.exit(exitCode); } - - process.exit(exitCode || 0); }; return cli;