mirror of
https://github.com/github/codeql-action.git
synced 2026-04-17 20:43:17 +00:00
Cache result of codeql version
This commit is contained in:
@@ -543,12 +543,15 @@ export function getCachedCodeQL(): CodeQL {
|
||||
}
|
||||
|
||||
function getCodeQLForCmd(cmd: string): CodeQL {
|
||||
let cachedVersion: undefined | Promise<string> = undefined;
|
||||
return {
|
||||
getPath() {
|
||||
return cmd;
|
||||
},
|
||||
async getVersion() {
|
||||
return await runTool(cmd, ["version", "--format=terse"]);
|
||||
if (cachedVersion === undefined)
|
||||
cachedVersion = runTool(cmd, ["version", "--format=terse"]);
|
||||
return await cachedVersion;
|
||||
},
|
||||
async printVersion() {
|
||||
await runTool(cmd, ["version", "--format=json"]);
|
||||
|
||||
Reference in New Issue
Block a user