diff --git a/npm/shellroute/bin/shellroute b/npm/shellroute/bin/shellroute index 98030c6..5ebfcfe 100755 --- a/npm/shellroute/bin/shellroute +++ b/npm/shellroute/bin/shellroute @@ -1,25 +1,25 @@ #!/usr/bin/env node -const { execFileSync } = require("child_process"); -const path = require("path"); -const os = require("os"); +var execFileSync = require("child_process").execFileSync; +var path = require("path"); +var os = require("os"); -const PLATFORMS = { +var PLATFORMS = { "darwin-arm64": "@shellroute/cli-darwin-arm64", "darwin-x64": "@shellroute/cli-darwin-x64", "linux-arm64": "@shellroute/cli-linux-arm64", "linux-x64": "@shellroute/cli-linux-x64", }; -const key = `${os.platform()}-${os.arch()}`; -const pkg = PLATFORMS[key]; +var key = os.platform() + "-" + os.arch(); +var pkg = PLATFORMS[key]; if (!pkg) { - console.error(`Unsupported platform: ${key}`); + console.error("Unsupported platform: " + key); process.exit(1); } try { - const binPath = path.join(require.resolve(`${pkg}/package.json`), "..", "bin", "shellroute"); + var binPath = path.join(require.resolve(pkg + "/package.json"), "..", "bin", "shellroute"); execFileSync(binPath, process.argv.slice(2), { stdio: "inherit" }); } catch (e) { - process.exit(e.status ?? 1); + process.exit(e.status != null ? e.status : 1); }