Fix call to endGroup

Also, rename variable and change a comment.
This commit is contained in:
Andrew Eisenberg 2022-08-30 08:54:21 -07:00
parent 354bc9f629
commit 7294b404d8
3 changed files with 27 additions and 23 deletions

23
lib/config-utils.js generated
View file

@ -905,8 +905,9 @@ async function initConfig(languagesInput, queriesInput, packsInput, configFile,
"Please make sure that the default queries are enabled, or you are specifying queries to run.");
}
}
// if using the codescanning config in the CLI, pack downloads
// happen in the CLI, so no need to do them here.
// When using the codescanning config in the CLI, pack downloads
// happen in the CLI during the `database init` command, so no need
// to download them here.
if (!(await (0, util_1.useCodeScanningConfigInCli)(codeQL))) {
await downloadPacks(codeQL, config.languages, config.packs, logger);
}
@ -995,26 +996,26 @@ async function getConfig(tempDir, logger) {
}
exports.getConfig = getConfig;
async function downloadPacks(codeQL, languages, packs, logger) {
let packsDownloaded = 0;
let numPacksDownloaded = 0;
logger.startGroup("Downloading packs");
for (const language of languages) {
const packsWithVersion = packs[language];
if (packsWithVersion === null || packsWithVersion === void 0 ? void 0 : packsWithVersion.length) {
logger.info(`Downloading custom packs for ${language}`);
const results = await codeQL.packDownload(packsWithVersion);
packsDownloaded += results.packs.length;
numPacksDownloaded += results.packs.length;
logger.info(`Downloaded packs: ${results.packs
.map((r) => `${r.name}@${r.version || "latest"}`)
.join(", ")}`);
}
if (packsDownloaded) {
logger.info(`Downloaded ${packsDownloaded} packs`);
}
else {
logger.info("No packs to download");
}
logger.endGroup();
}
if (numPacksDownloaded > 0) {
logger.info(`Downloaded ${numPacksDownloaded} ${packs === 1 ? "pack" : "packs"}`);
}
else {
logger.info("No packs to download");
}
logger.endGroup();
}
exports.downloadPacks = downloadPacks;
//# sourceMappingURL=config-utils.js.map

File diff suppressed because one or more lines are too long