Add configuration option to set CodeQL DB location

This commit is contained in:
Edoardo Pirovano 2021-05-17 10:35:09 +01:00 committed by Edoardo Pirovano
parent feccdcb876
commit 79c79f1be5
38 changed files with 133 additions and 79 deletions

View file

@ -8,6 +8,7 @@ import * as semver from "semver";
import { getApiClient, GitHubApiDetails } from "./api-client";
import * as apiCompatibility from "./api-compatibility.json";
import { Config } from "./config-utils";
import { Language } from "./languages";
import { Logger } from "./logging";
@ -171,18 +172,11 @@ export function getThreadsFlag(
return `--threads=${numThreads}`;
}
/**
* Get the directory where CodeQL databases should be placed.
*/
export function getCodeQLDatabasesDir(tempDir: string) {
return path.resolve(tempDir, "codeql_databases");
}
/**
* Get the path where the CodeQL database for the given language lives.
*/
export function getCodeQLDatabasePath(tempDir: string, language: Language) {
return path.resolve(getCodeQLDatabasesDir(tempDir), language);
export function getCodeQLDatabasePath(config: Config, language: Language) {
return path.resolve(config.dbLocation, language);
}
/**