improve error message when config is not found
This commit is contained in:
parent
37bac22443
commit
80e2c4fe4a
12 changed files with 39 additions and 19 deletions
|
|
@ -188,6 +188,10 @@ program
|
|||
const logger = getRunnerLogger(cmd.debug);
|
||||
try {
|
||||
const config = await getConfig(getTempDir(cmd.tempDir), logger);
|
||||
if (config === undefined) {
|
||||
throw new Error("Config file could not be found at expected location. " +
|
||||
"Was the 'init' command run with the same '--temp-dir' argument as this command.");
|
||||
}
|
||||
checkEnvironmentSetup(config);
|
||||
let language: Language | undefined = undefined;
|
||||
if (cmd.language !== undefined) {
|
||||
|
|
@ -241,6 +245,10 @@ program
|
|||
const tempDir = getTempDir(cmd.tempDir);
|
||||
const outputDir = cmd.outputDir || path.join(tempDir, 'codeql-sarif');
|
||||
const config = await getConfig(getTempDir(cmd.tempDir), logger);
|
||||
if (config === undefined) {
|
||||
throw new Error("Config file could not be found at expected location. " +
|
||||
"Was the 'init' command run with the same '--temp-dir' argument as this command.");
|
||||
}
|
||||
checkEnvironmentSetup(config);
|
||||
await runAnalyze(
|
||||
parseRepositoryNwo(cmd.repository),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue