Allow the version of the ML-powered pack to depend on the CLI version

This commit is contained in:
Henry Mercer 2022-03-31 14:41:16 +01:00
parent dd6b592e3e
commit 2c03704a6c
9 changed files with 31 additions and 26 deletions

5
lib/codeql.js generated
View file

@ -474,9 +474,8 @@ async function getCodeQLForCmd(cmd, checkVersion) {
if (config.injectedMlQueries) {
// We need to inject the ML queries into the original user input before
// we pass this on to the CLI, to make sure these get run.
let packString = util_1.ML_POWERED_JS_QUERIES_PACK.packName;
if (util_1.ML_POWERED_JS_QUERIES_PACK.version)
packString = `${packString}@${util_1.ML_POWERED_JS_QUERIES_PACK.version}`;
const pack = await util.getMlPoweredJsQueriesPack(codeql);
const packString = pack.packName + (pack.version ? `@${pack.version}` : "");
if (augmentedConfig.packs === undefined)
augmentedConfig.packs = [];
if (Array.isArray(augmentedConfig.packs)) {