diff --git a/src/compiler/sys.ts b/src/compiler/sys.ts index ee6c9edc3b..e9f15b6fa8 100644 --- a/src/compiler/sys.ts +++ b/src/compiler/sys.ts @@ -508,6 +508,9 @@ namespace ts { echo(s: string): void; quit(exitCode?: number): void; fileExists(path: string): boolean; + deleteFile(path: string): boolean; + getModifiedTime(path: string): Date; + setModifiedTime(path: string, time: Date): void; directoryExists(path: string): boolean; createDirectory(path: string): void; resolvePath(path: string): string; @@ -1135,6 +1138,9 @@ namespace ts { }, resolvePath: ChakraHost.resolvePath, fileExists: ChakraHost.fileExists, + deleteFile: ChakraHost.deleteFile, + getModifiedTime: ChakraHost.getModifiedTime, + setModifiedTime: ChakraHost.setModifiedTime, directoryExists: ChakraHost.directoryExists, createDirectory: ChakraHost.createDirectory, getExecutingFilePath: () => ChakraHost.executingFile, diff --git a/src/tsc/tsc.ts b/src/tsc/tsc.ts index 47d2c0b5c7..97e239c8bc 100644 --- a/src/tsc/tsc.ts +++ b/src/tsc/tsc.ts @@ -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,