From c9b8915a23a883b5b76868c227fcc58ae6ed694d Mon Sep 17 00:00:00 2001 From: Minteck Date: Sat, 12 Feb 2022 17:20:52 +0100 Subject: Update --- commands/install.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'commands/install.js') diff --git a/commands/install.js b/commands/install.js index b65725d..6f0df0c 100644 --- a/commands/install.js +++ b/commands/install.js @@ -145,6 +145,14 @@ module.exports = async (argv) => { spinner.succeed("Extracting package... done"); console.log(" Size change: +" + require('../hooks/size')(pkg.id)); + 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); + } else if (os.platform() === "darwin" && typeof pkg.executable.mac === "string") { + fs.writeFileSync(os.homedir() + "/.twilight/binaries/" + pkg.id + ".sh", pkg.executable.mac); + } + let postinstall = []; if (os.platform() === "win32") postinstall = pkg.postinstall.windows; if (os.platform() === "linux") postinstall = pkg.postinstall.linux; -- cgit