From ba67ef1083f8b33e3c45c571f0d48cada088cb7e Mon Sep 17 00:00:00 2001 From: Remy Sharp Date: Sun, 22 May 2016 22:24:37 +0100 Subject: [PATCH] fix: when in debug, output verbose line-by-line --- cli/index.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/cli/index.js b/cli/index.js index 4206c0d..790abdb 100755 --- a/cli/index.js +++ b/cli/index.js @@ -98,11 +98,16 @@ function main() { '\nLast job: ' + progress + styles.gray.close; - process.stderr.write( - ansi.cursorRestorePosition + - ansi.cursorLeft + - ansi.eraseLines(2) + - str.trim() + '\n'); + if (argv.debug) { + process.stderr.write( + str.trim() + '\n'); + } else { + process.stderr.write( + ansi.cursorRestorePosition + + ansi.cursorLeft + + ansi.eraseLines(2) + + str.trim() + '\n'); + } }; inliner.on('progress', function progressEvent(event) { @@ -138,5 +143,7 @@ function main() { console.warn('warning: ' + event); }); } + }).catch(function (error) { + console.error(error.stack); }); }