Merge pull request #25202 from RyanCavanaugh/addChakraAPIs
Add Chakra APIs for tsc.exe --build
This commit is contained in:
commit
e38aad8b79
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue