Don't bail wrongly in tsc -b -w

This commit is contained in:
Ryan Cavanaugh 2018-06-13 13:59:52 -07:00
parent 9d3bc1b0a4
commit 1bd1899d5a

View File

@ -58,7 +58,14 @@ namespace ts {
message: report,
errorDiagnostic: d => reportDiag(d)
};
return sys.exit(performBuild(args.slice(1), createCompilerHost({}), buildHost, sys));
const result = performBuild(args.slice(1), createCompilerHost({}), buildHost, sys);
// undefined = in watch mode, do not exit
if (result !== undefined) {
return sys.exit(result);
}
else {
return;
}
}
const commandLine = parseCommandLine(args);