mirror of
https://github.com/ragestudio/relic.git
synced 2025-06-09 10:34:18 +00:00
handle "pkg_auto_update_on_execute" setting
This commit is contained in:
parent
e7605dc80a
commit
be5b1ca99a
@ -7,6 +7,8 @@ import initManifest from "../../utils/initManifest"
|
||||
import parseStringVars from "../../utils/parseStringVars"
|
||||
import sendToRender from "../../utils/sendToRender"
|
||||
|
||||
import UpdateCMD from "./update"
|
||||
|
||||
export default async function execute(pkg_id, { force = false } = {}) {
|
||||
let pkg = await getInstalledPackages(pkg_id)
|
||||
|
||||
@ -36,8 +38,10 @@ export default async function execute(pkg_id, { force = false } = {}) {
|
||||
if (pkg._original_manifest) {
|
||||
if ((pkg._original_manifest.version !== pkg.version) && !force) {
|
||||
console.log(`[${pkg_id}] execute() | Update available (${pkg._original_manifest.version} -> ${pkg.version}). Aborting...`,)
|
||||
console.log(pkg._original_manifest)
|
||||
|
||||
if (global.SettingsStore.get("pkg_auto_update_on_execute") === true) {
|
||||
await UpdateCMD(pkg_id)
|
||||
} else {
|
||||
sendToRender("pkg:update_available", {
|
||||
manifest: pkg._original_manifest,
|
||||
current_version: pkg._original_manifest.version,
|
||||
@ -53,6 +57,7 @@ export default async function execute(pkg_id, { force = false } = {}) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof pkg.after_execute === "function") {
|
||||
await pkg.after_execute(pkg)
|
||||
|
Loading…
x
Reference in New Issue
Block a user