From 3ba5c34afc7ab08389d17a49b3593693a6074b25 Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Sun, 19 Jul 2020 13:16:53 +0100 Subject: [PATCH] fix: on non tty streams License: MIT Signed-off-by: Henrique Dias --- lib/helpers.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/helpers.js b/lib/helpers.js index f23c45b..25e0117 100644 --- a/lib/helpers.js +++ b/lib/helpers.js @@ -1,7 +1,11 @@ const progress = (str) => { - process.stdout.clearLine() - process.stdout.cursorTo(0) - process.stdout.write(str) + if (process.stdout.isTTY) { + process.stdout.clearLine() + process.stdout.cursorTo(0) + process.stdout.write(str) + } else { + console.log(str) + } } const pad = (str, max) => {