Cache result of codeql version
This commit is contained in:
parent
f0a2954c12
commit
4ba53e33d7
3 changed files with 9 additions and 3 deletions
|
|
@ -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"]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue