Fix to not output newline if redirecting to a file (#89)

This commit is contained in:
operator-name 2019-09-09 17:07:15 +01:00 committed by Kyle Spearrin
parent 6c1752d86f
commit 3915e43435
1 changed files with 1 additions and 1 deletions

View File

@ -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');