diff options
Diffstat (limited to 'commands/install.js')
-rw-r--r-- | commands/install.js | 8 |
1 files changed, 8 insertions, 0 deletions
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; |