aboutsummaryrefslogtreecommitdiff
path: root/commands/upgrade.js
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2022-02-12 22:08:32 +0100
committerMinteck <contact@minteck.org>2022-02-12 22:08:46 +0100
commit4e1b39ae15c09753b7d6b557ba69f9c25bf6aca0 (patch)
treeea7221c687321f61fba0b907db067e9122f3db6f /commands/upgrade.js
parent3342fe6c86796bd7ef896f683e2ef4c8b6c74cc9 (diff)
downloadtwilight-4e1b39ae15c09753b7d6b557ba69f9c25bf6aca0.tar.gz
twilight-4e1b39ae15c09753b7d6b557ba69f9c25bf6aca0.tar.bz2
twilight-4e1b39ae15c09753b7d6b557ba69f9c25bf6aca0.zip
Fix
Diffstat (limited to 'commands/upgrade.js')
-rw-r--r--commands/upgrade.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/commands/upgrade.js b/commands/upgrade.js
index 93d906d..2eab887 100644
--- a/commands/upgrade.js
+++ b/commands/upgrade.js
@@ -89,6 +89,11 @@ async function processQueue() {
spinner.succeed("Extracting package... done");
console.log(" Size change: " + change);
+ let exec = argv.package;
+ if (typeof JSON.parse(fs.readFileSync(home + "/repository/" + dir + "/" + argv.package + ".json").toString()).execname === "string") {
+ exec = JSON.parse(fs.readFileSync(home + "/repository/" + dir + "/" + argv.package + ".json").toString()).execname;
+ }
+
if (os.platform() === "win32" && typeof pkg.executable.windows === "string") {
fs.writeFileSync(os.homedir() + "/.twilight/binaries/" + pkg.id + ".bat", pkg.executable.windows);
} else if (os.platform() === "linux" && typeof pkg.executable.linux === "string") {