Warn when multiple bundles for a single CLI are found in the toolcache

This commit is contained in:
Henry Mercer 2023-02-06 12:28:33 +00:00
parent d49282c3b5
commit d3f2b2e6d2
3 changed files with 17 additions and 6 deletions

View file

@ -459,11 +459,17 @@ export async function getCodeQLSource(
"toolcache, using that."
);
codeqlFolder = toolcache.find("CodeQL", candidateVersions[0]);
} else {
} else if (candidateVersions.length === 0) {
logger.debug(
`Did not find exactly one version of the CodeQL tools starting with ${cliVersion} ` +
`(instead found ${candidateVersions.length}). Trying next fallback method.`
`Didn't find any versions of the CodeQL tools starting with ${cliVersion} ` +
`in the toolcache. Trying next fallback method.`
);
} else {
logger.warning(
`Found ${candidateVersions.length} versions of the CodeQL tools starting with ` +
`${cliVersion} in the toolcache, but at most one was expected.`
);
logger.debug("Trying next fallback method.");
}
}
}