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

View file

@ -612,12 +612,17 @@ export async function getCodeQLForCmd(
extraArgs.push("--no-sublanguage-file-coverage");
}
const overwriteFlag = isSupportedToolsFeature(
await this.getVersion(),
ToolsFeature.ForceOverwite,
) ? "--force-overwrite" : "--overwrite";
await runTool(
cmd,
[
"database",
"init",
"--overwrite",
overwriteFlag,
"--db-cluster",
config.dbLocation,
`--source-root=${sourceRoot}`,