aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2022-02-12 20:41:58 +0100
committerMinteck <contact@minteck.org>2022-02-12 20:41:58 +0100
commit02f3a0713f3c8b37d71032c09b8188d79bfc1456 (patch)
treea28a2ce8f938c284247561b2ebe0450272663d49
parent5c62e5a5c5f61b43b7788528872996772e39e10e (diff)
downloadtwilight-02f3a0713f3c8b37d71032c09b8188d79bfc1456.tar.gz
twilight-02f3a0713f3c8b37d71032c09b8188d79bfc1456.tar.bz2
twilight-02f3a0713f3c8b37d71032c09b8188d79bfc1456.zip
Fixes for Linux
-rw-r--r--commands/install.js6
-rw-r--r--commands/upgrade.js6
2 files changed, 8 insertions, 4 deletions
diff --git a/commands/install.js b/commands/install.js
index b08ebe5..8586e91 100644
--- a/commands/install.js
+++ b/commands/install.js
@@ -153,9 +153,11 @@ module.exports = async (argv) => {
if (os.platform() === "win32" && typeof pkg.executable.windows === "string") {
fs.writeFileSync(os.homedir() + "/.twilight/binaries/" + exec + ".bat", pkg.executable.windows);
} else if (os.platform() === "linux" && typeof pkg.executable.linux === "string") {
- fs.writeFileSync(os.homedir() + "/.twilight/binaries/" + exec + ".sh", pkg.executable.linux);
+ fs.writeFileSync(os.homedir() + "/.twilight/binaries/" + exec, pkg.executable.linux);
+ require('child_process').spawnSync("chmod", [ "+x", os.homedir() + "/.twilight/binaries/" + exec ])
} else if (os.platform() === "darwin" && typeof pkg.executable.mac === "string") {
- fs.writeFileSync(os.homedir() + "/.twilight/binaries/" + exec + ".sh", pkg.executable.mac);
+ fs.writeFileSync(os.homedir() + "/.twilight/binaries/" + exec, pkg.executable.mac);
+ require('child_process').spawnSync("chmod", [ "+x", os.homedir() + "/.twilight/binaries/" + exec ])
}
let postinstall = [];
diff --git a/commands/upgrade.js b/commands/upgrade.js
index c6ebbec..01f6be9 100644
--- a/commands/upgrade.js
+++ b/commands/upgrade.js
@@ -128,9 +128,11 @@ module.exports = async (argv) => {
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") {
- fs.writeFileSync(os.homedir() + "/.twilight/binaries/" + pkg.id + ".sh", pkg.executable.linux);
+ fs.writeFileSync(os.homedir() + "/.twilight/binaries/" + exec, pkg.executable.linux);
+ require('child_process').spawnSync("chmod", [ "+x", os.homedir() + "/.twilight/binaries/" + exec ])
} else if (os.platform() === "darwin" && typeof pkg.executable.mac === "string") {
- fs.writeFileSync(os.homedir() + "/.twilight/binaries/" + pkg.id + ".sh", pkg.executable.mac);
+ fs.writeFileSync(os.homedir() + "/.twilight/binaries/" + exec, pkg.executable.mac);
+ require('child_process').spawnSync("chmod", [ "+x", os.homedir() + "/.twilight/binaries/" + exec ])
}
let postinstall = [];