fix(36385): return failed exit code if tsconfig doesn't exist and there are no input files. (#36474)

This commit is contained in:
Alexander T
2020-01-29 02:11:19 +02:00
committed by GitHub
parent 8eee8db192
commit 39311da27b
4 changed files with 63 additions and 3 deletions

View File

@@ -243,13 +243,12 @@ namespace ts {
if (commandLine.fileNames.length === 0 && !configFileName) {
if (commandLine.options.showConfig) {
reportDiagnostic(createCompilerDiagnostic(Diagnostics.Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0, normalizePath(sys.getCurrentDirectory())));
return sys.exit(ExitStatus.DiagnosticsPresent_OutputsSkipped);
}
else {
printVersion(sys);
printHelp(sys, getOptionsForHelp(commandLine));
return sys.exit(ExitStatus.Success);
}
return sys.exit(ExitStatus.DiagnosticsPresent_OutputsSkipped);
}
const currentDirectory = sys.getCurrentDirectory();
@@ -739,4 +738,4 @@ namespace ts {
return;
}
}
}