From 3915e43435e3fa311470d90f9817727cc05d168a Mon Sep 17 00:00:00 2001 From: operator-name Date: Mon, 9 Sep 2019 17:07:15 +0100 Subject: [PATCH] Fix to not output newline if redirecting to a file (#89) --- src/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.ts b/src/utils.ts index 3124f6efc5..d001095e4d 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -10,7 +10,7 @@ import { NodeUtils } from 'jslib/misc/nodeUtils'; export class CliUtils { static writeLn(s: string, finalLine: boolean = false, error: boolean = false) { const stream = error ? process.stderr : process.stdout; - if (finalLine && process.platform === 'win32') { + if (finalLine && (process.platform === 'win32' || !stream.isTTY)) { stream.write(s); } else { stream.write(s + '\n');