Use --force-overwrite for creating databases

...but only if the feature exists in the CLI.
This commit is contained in:
Andrew Eisenberg 2024-06-11 11:38:18 -07:00
parent c7964947b4
commit 0a64ae0929
No known key found for this signature in database
6 changed files with 12 additions and 4 deletions

3
lib/codeql.js generated
View file

@ -283,10 +283,11 @@ async function getCodeQLForCmd(cmd, checkVersion) {
else if (await util.codeQlVersionAtLeast(this, exports.CODEQL_VERSION_SUBLANGUAGE_FILE_COVERAGE)) {
extraArgs.push("--no-sublanguage-file-coverage");
}
const overwriteFlag = (0, tools_features_1.isSupportedToolsFeature)(await this.getVersion(), tools_features_1.ToolsFeature.ForceOverwite) ? "--force-overwrite" : "--overwrite";
await runTool(cmd, [
"database",
"init",
"--overwrite",
overwriteFlag,
"--db-cluster",
config.dbLocation,
`--source-root=${sourceRoot}`,