Skip to content

Commit 1b8f5b1

Browse files
committed
fix: mistakenly removed this bin/mux script which is the ship needed for the mux/cli package (wrapper)
1 parent 5322f2f commit 1b8f5b1

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

bin/mux

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env node
2+
const { platform, arch, env } = process;
3+
4+
const PLATFORMS = {
5+
darwin: {
6+
x64: "@mux/cli-darwin-x64/mux",
7+
arm64: "@mux/cli-darwin-arm64/mux",
8+
},
9+
linux: {
10+
x64: "@mux/cli-linux-x64/mux",
11+
arm64: "@mux/cli-linux-arm64/mux",
12+
},
13+
};
14+
15+
const binPath = env.MUX_BINARY || PLATFORMS?.[platform]?.[arch];
16+
17+
if (binPath) {
18+
const result = require("child_process").spawnSync(
19+
require.resolve(binPath),
20+
process.argv.slice(2),
21+
{ shell: false, stdio: "inherit" },
22+
);
23+
if (result.error) throw result.error;
24+
process.exitCode = result.status;
25+
} else {
26+
console.error(
27+
`The Mux CLI doesn't ship prebuilt binaries for your platform (${platform}/${arch}) yet.\n` +
28+
"You can build from source: https://github.com/muxinc/cli"
29+
);
30+
process.exitCode = 1;
31+
}

0 commit comments

Comments
 (0)