mirror of
https://github.com/ragestudio/relic.git
synced 2025-06-09 10:34:18 +00:00
handle config
This commit is contained in:
parent
2f40c0b726
commit
7ea86da788
@ -274,6 +274,18 @@ export default class PkgManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (changes.configs) {
|
||||||
|
if (!manifest.storaged_configs) {
|
||||||
|
manifest.storaged_configs = {}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Object.keys(changes.configs).length !== 0) {
|
||||||
|
Object.entries(changes.configs).forEach(([key, value]) => {
|
||||||
|
manifest.storaged_configs[key] = value
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
manifest.status = "installed"
|
manifest.status = "installed"
|
||||||
|
|
||||||
sendToRender(`installation:done`, {
|
sendToRender(`installation:done`, {
|
||||||
@ -583,20 +595,33 @@ export default class PkgManager {
|
|||||||
process.on("error", reject)
|
process.on("error", reject)
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
if (typeof manifest.execute !== "function") {
|
try {
|
||||||
sendToRender("installation:status", {
|
if (typeof manifest.execute !== "function") {
|
||||||
|
sendToRender("installation:status", {
|
||||||
|
status: "execution_failed",
|
||||||
|
...manifest,
|
||||||
|
})
|
||||||
|
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
await manifest.execute({
|
||||||
|
manifest,
|
||||||
|
pack_dir: manifest.install_path,
|
||||||
|
tmp_dir: TMP_PATH,
|
||||||
|
})
|
||||||
|
} catch (error) {
|
||||||
|
sendToRender("new:notification", {
|
||||||
|
message: "Failed to launch",
|
||||||
|
description: error.toString(),
|
||||||
|
type: "error",
|
||||||
|
})
|
||||||
|
|
||||||
|
return sendToRender("installation:status", {
|
||||||
status: "execution_failed",
|
status: "execution_failed",
|
||||||
...manifest,
|
...manifest,
|
||||||
})
|
})
|
||||||
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await manifest.execute({
|
|
||||||
manifest,
|
|
||||||
pack_dir: manifest.install_path,
|
|
||||||
tmp_dir: TMP_PATH
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sendToRender("installation:status", {
|
sendToRender("installation:status", {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user