Skip to content

Commit

Permalink
Electron : better default version management avec importing layers
Browse files Browse the repository at this point in the history
  • Loading branch information
fxi committed Apr 25, 2024
1 parent e6b1754 commit 8ca559f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions electron/src/main/modules/controller/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ export class Controller extends Classes([
ctr.sendMessageCodeClient("msg-info", "docker_reload_version");
await ctr.wait(2000, "start docker_load_file");
await versions.setVersion(meta.tag);
return;
}

ctr.sendMessageCodeClient("msg-info", "data_loc_check");
Expand Down
11 changes: 7 additions & 4 deletions electron/src/main/modules/versions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,14 @@ export class Versions {
const vrs = this;
const ctr = vrs._ctr;

console.log(version);

if (version === "latest") {
return vrs.updateLatest();
}
const vIsValid = semver.valid(version);

if (!vIsValid) {
throw new Error(`Invalid version ${version}`);
}

const vLoc = await vrs.hasVersionLocal(version);

Expand Down Expand Up @@ -428,8 +431,8 @@ export class Versions {
title: "Confirm",
message: `Are you sure you want to restart and use version ${version} ? `,
});

if (!choice) {
// yes
if (choice === 0) {
await vrs.setVersion(version);
}
}
Expand Down

0 comments on commit 8ca559f

Please sign in to comment.