Skip to content

Commit 055145c

Browse files
committed
hotfix: fix make start
1 parent 9660f51 commit 055145c

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ endif
158158

159159

160160
start: 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)
164164
build: node_modules/.installed src/version.ts build-renderer build-main build-preload build-icons build-static ## Build all targets

src/cli/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff 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+
3033
if (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

0 commit comments

Comments
 (0)