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

8
lib/entry-points.js generated
View File

@@ -177439,7 +177439,13 @@ async function getCodeQLForCmd(logger2, cmd, checkVersion) {
},
async diagnosticsExport(sarifFile, automationDetailsId, config, diagnosticDir) {
let configPath = getGeneratedCodeScanningConfigPath(config);
if (diagnosticDir !== void 0 && !fs17.existsSync(configPath)) {
if (!fs17.existsSync(configPath)) {
logger2.warning(
[
`Expected a configuration file at '${configPath}', which does not exist.`,
"Continuing with diagnostics export anyway, without a configuration file."
].join(" ")
);
configPath = void 0;
}
const args = [

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;
}