Ensure distribution state exists when installing distribution release
This commit is contained in:
@@ -317,6 +317,10 @@ class ExtensionSpecificDistributionManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async initialize() {
|
public async initialize() {
|
||||||
|
await this.ensureDistributionStateExists();
|
||||||
|
}
|
||||||
|
|
||||||
|
private async ensureDistributionStateExists() {
|
||||||
const distributionStatePath = this.getDistributionStatePath();
|
const distributionStatePath = this.getDistributionStatePath();
|
||||||
try {
|
try {
|
||||||
this.distributionState = await readJson(distributionStatePath);
|
this.distributionState = await readJson(distributionStatePath);
|
||||||
@@ -414,6 +418,10 @@ class ExtensionSpecificDistributionManager {
|
|||||||
release: Release,
|
release: Release,
|
||||||
progressCallback?: ProgressCallback,
|
progressCallback?: ProgressCallback,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
|
if (!this.distributionState) {
|
||||||
|
await this.ensureDistributionStateExists();
|
||||||
|
}
|
||||||
|
|
||||||
const distributionStatePath = this.getDistributionStatePath();
|
const distributionStatePath = this.getDistributionStatePath();
|
||||||
|
|
||||||
await withDistributionUpdateLock(
|
await withDistributionUpdateLock(
|
||||||
|
|||||||
Reference in New Issue
Block a user