Throw configuration error when tar is not available

This commit is contained in:
Angela P Wen 2024-11-18 11:21:11 -08:00
parent a1695c562b
commit b500b62cea
9 changed files with 41 additions and 30 deletions

3
lib/setup-codeql.js generated
View file

@ -463,6 +463,9 @@ function getCanonicalToolcacheVersion(cliVersion, bundleVersion, logger) {
* @returns the path to the extracted bundle, and the version of the tools
*/
async function setupCodeQLBundle(toolsInput, apiDetails, tempDir, variant, features, defaultCliVersion, logger) {
if (!(await util.isBinaryAccessible("tar", logger))) {
throw new util.ConfigurationError("Could not find tar in PATH, so unable to extract CodeQL bundle.");
}
const zstdAvailability = await tar.isZstdAvailable(logger);
const source = await getCodeQLSource(toolsInput, defaultCliVersion, apiDetails, variant, zstdAvailability.available, logger);
let codeqlFolder;