Run the pack download command

This commit is contained in:
Andrew Eisenberg 2021-06-04 13:44:24 -07:00
parent 06687e95c8
commit d87945e9fd
9 changed files with 73 additions and 7 deletions

8
lib/analyze.js generated
View file

@ -96,6 +96,13 @@ async function runQueries(sarifFolder, memoryFlag, addSnippetsFlag, threadsFlag,
throw new Error(`Unable to analyse ${language} as no queries were selected for this language`);
}
try {
if (hasPackWithCustomQueries) {
const codeql = codeql_1.getCodeQL(config.codeQLCmd);
const results = await codeql.packDownload(packsWithVersion);
logger.info(`Downloaded packs: ${results.packs
.map((r) => `${r.name}@${r.version || "latest"}`)
.join(", ")}`);
}
let analysisSummaryBuiltIn = "";
const customAnalysisSummaries = [];
if (queries["builtin"].length > 0) {
@ -150,6 +157,7 @@ async function runQueries(sarifFolder, memoryFlag, addSnippetsFlag, threadsFlag,
}
catch (e) {
logger.info(e);
logger.info(e.stack);
statusReport.analyze_failure_language = language;
throw new CodeQLAnalysisError(statusReport, `Error running analysis for ${language}: ${e}`);
}