Skip to content

Commit e38aad8

Browse files
Merge pull request microsoft#25202 from RyanCavanaugh/addChakraAPIs
Add Chakra APIs for tsc.exe --build
2 parents 17673e8 + fa9f071 commit e38aad8

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/compiler/sys.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,9 @@ namespace ts {
508508
echo(s: string): void;
509509
quit(exitCode?: number): void;
510510
fileExists(path: string): boolean;
511+
deleteFile(path: string): boolean;
512+
getModifiedTime(path: string): Date;
513+
setModifiedTime(path: string, time: Date): void;
511514
directoryExists(path: string): boolean;
512515
createDirectory(path: string): void;
513516
resolvePath(path: string): string;
@@ -1135,6 +1138,9 @@ namespace ts {
11351138
},
11361139
resolvePath: ChakraHost.resolvePath,
11371140
fileExists: ChakraHost.fileExists,
1141+
deleteFile: ChakraHost.deleteFile,
1142+
getModifiedTime: ChakraHost.getModifiedTime,
1143+
setModifiedTime: ChakraHost.setModifiedTime,
11381144
directoryExists: ChakraHost.directoryExists,
11391145
createDirectory: ChakraHost.createDirectory,
11401146
getExecutingFilePath: () => ChakraHost.executingFile,

src/tsc/tsc.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,13 @@ namespace ts {
1919
}
2020
}
2121

22+
function defaultIsPretty() {
23+
return !!sys.writeOutputIsTTY && sys.writeOutputIsTTY();
24+
}
25+
2226
function shouldBePretty(options: CompilerOptions) {
2327
if (typeof options.pretty === "undefined") {
24-
return !!sys.writeOutputIsTTY && sys.writeOutputIsTTY();
28+
return defaultIsPretty();
2529
}
2630
return options.pretty;
2731
}
@@ -50,7 +54,7 @@ namespace ts {
5054

5155
export function executeCommandLine(args: string[]): void {
5256
if (args.length > 0 && ((args[0].toLowerCase() === "--build") || (args[0].toLowerCase() === "-b"))) {
53-
const reportDiag = createDiagnosticReporter(sys, /*pretty*/ true);
57+
const reportDiag = createDiagnosticReporter(sys, defaultIsPretty());
5458
const report = (message: DiagnosticMessage, ...args: string[]) => reportDiag(createCompilerDiagnostic(message, ...args));
5559
const buildHost: BuildHost = {
5660
error: report,

0 commit comments

Comments
 (0)