Always check whether config file exists

And emit a warning if it doesn't
This commit is contained in:
Michael B. Gale
2026-10-21 12:28:26 +01:00
parent d7bad7d923
commit 98b8e51380
2 changed files with 14 additions and 2 deletions

View File

@@ -927,7 +927,13 @@ async function getCodeQLForCmd(
let configPath: string | undefined =
getGeneratedCodeScanningConfigPath(config);
if (diagnosticDir !== undefined && !fs.existsSync(configPath)) {
if (!fs.existsSync(configPath)) {
logger.warning(
[
`Expected a configuration file at '${configPath}', which does not exist.`,
"Continuing with diagnostics export anyway, without a configuration file.",
].join(" "),
);
configPath = undefined;
}