File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -158,7 +158,7 @@ endif
158158
159159
160160start : node_modules/.installed build-main build-preload build-static # # Build and start Electron app
161- @NODE_ENV=development bun x electron --remote-debugging-port=9222 .
161+ @NODE_ENV=development bunx electron --remote-debugging-port=9222 .
162162
163163# # Build targets (can run in parallel)
164164build : node_modules/.installed src/version.ts build-renderer build-main build-preload build-icons build-static # # Build all targets
Original file line number Diff line number Diff line change @@ -27,6 +27,9 @@ function launchDesktop(): void {
2727}
2828
2929// Route known subcommands to their dedicated entry points (each has its own Commander instance)
30+ // When Electron launches us (e.g., `bunx electron --flags .`), argv[2] may be a flag or "." - not a subcommand
31+ const isElectronLaunchArg = subcommand ?. startsWith ( "-" ) || subcommand === "." ;
32+
3033if ( subcommand === "run" ) {
3134 process . argv . splice ( 2 , 1 ) ; // Remove "run" since run.ts defines .name("mux run")
3235 // eslint-disable-next-line @typescript-eslint/no-require-imports
@@ -39,8 +42,8 @@ if (subcommand === "run") {
3942 process . argv . splice ( 2 , 1 ) ;
4043 // eslint-disable-next-line @typescript-eslint/no-require-imports
4144 require ( "./api" ) ;
42- } else if ( subcommand === "desktop" || ( subcommand === undefined && isElectron ) ) {
43- // Explicit `mux desktop` or no args when running under Electron
45+ } else if ( subcommand === "desktop" || ( isElectron && ( subcommand === undefined || isElectronLaunchArg ) ) ) {
46+ // Explicit `mux desktop`, or Electron runtime with no subcommand / Electron launch args
4447 launchDesktop ( ) ;
4548} else {
4649 // No subcommand (non-Electron), flags (--help, --version), or unknown commands
You can’t perform that action at this time.
0 commit comments