File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments