Skip to content

Commit c284f21

Browse files
committed
Ensure distribution state exists when installing distribution release
1 parent f76100b commit c284f21

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

extensions/ql-vscode/src/codeql-cli/distribution.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,10 @@ class ExtensionSpecificDistributionManager {
317317
}
318318

319319
public async initialize() {
320+
await this.ensureDistributionStateExists();
321+
}
322+
323+
private async ensureDistributionStateExists() {
320324
const distributionStatePath = this.getDistributionStatePath();
321325
try {
322326
this.distributionState = await readJson(distributionStatePath);
@@ -414,6 +418,10 @@ class ExtensionSpecificDistributionManager {
414418
release: Release,
415419
progressCallback?: ProgressCallback,
416420
): Promise<void> {
421+
if (!this.distributionState) {
422+
await this.ensureDistributionStateExists();
423+
}
424+
417425
const distributionStatePath = this.getDistributionStatePath();
418426

419427
await withDistributionUpdateLock(

0 commit comments

Comments
 (0)