exec on finish

This commit is contained in:
SrGooglo 2024-02-02 16:36:34 +01:00
parent 6a85669d5a
commit 2088ee7ee5
2 changed files with 9 additions and 3 deletions

View File

@ -45,8 +45,12 @@ class ElectronApp {
"pkg:install": async (event, manifest) => { "pkg:install": async (event, manifest) => {
this.pkgManager.install(manifest) this.pkgManager.install(manifest)
}, },
"pkg:update": (event, manifest_id) => { "pkg:update": async (event, manifest_id, { execOnFinish = false } = {}) => {
this.pkgManager.update(manifest_id) await this.pkgManager.update(manifest_id)
if(execOnFinish) {
await this.pkgManager.execute(manifest_id)
}
}, },
"pkg:apply": (event, manifest_id, changes) => { "pkg:apply": (event, manifest_id, changes) => {
this.pkgManager.applyChanges(manifest_id, changes) this.pkgManager.applyChanges(manifest_id, changes)

View File

@ -5,7 +5,9 @@ import "./index.less"
const PackageUpdateAvailable = ({ update, close }) => { const PackageUpdateAvailable = ({ update, close }) => {
function handleUpdate() { function handleUpdate() {
ipc.exec("pkg:update", update.manifest.id) ipc.exec("pkg:update", update.manifest.id, {
execOnFinish: true
})
close() close()
} }