mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-20 13:45:34 -05:00
Don't try to write --pretty results to unsupported consoles in --build
This commit is contained in:
@@ -19,9 +19,13 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
function defaultIsPretty() {
|
||||
return !!sys.writeOutputIsTTY && sys.writeOutputIsTTY();
|
||||
}
|
||||
|
||||
function shouldBePretty(options: CompilerOptions) {
|
||||
if (typeof options.pretty === "undefined") {
|
||||
return !!sys.writeOutputIsTTY && sys.writeOutputIsTTY();
|
||||
return defaultIsPretty();
|
||||
}
|
||||
return options.pretty;
|
||||
}
|
||||
@@ -50,7 +54,7 @@ namespace ts {
|
||||
|
||||
export function executeCommandLine(args: string[]): void {
|
||||
if (args.length > 0 && ((args[0].toLowerCase() === "--build") || (args[0].toLowerCase() === "-b"))) {
|
||||
const reportDiag = createDiagnosticReporter(sys, /*pretty*/ true);
|
||||
const reportDiag = createDiagnosticReporter(sys, defaultIsPretty());
|
||||
const report = (message: DiagnosticMessage, ...args: string[]) => reportDiag(createCompilerDiagnostic(message, ...args));
|
||||
const buildHost: BuildHost = {
|
||||
error: report,
|
||||
|
||||
Reference in New Issue
Block a user