()
| 74 | } |
| 75 | |
| 76 | export function resolveHappyCliExecutable(): string { |
| 77 | const override = process.env[HAPI_CLI_EXECUTABLE_ENV]?.trim(); |
| 78 | if (override && isCrossPlatformAbsolutePath(override) && existsSync(override)) { |
| 79 | return override; |
| 80 | } |
| 81 | |
| 82 | const argv0 = process.argv[0]?.trim(); |
| 83 | if (argv0 && isCrossPlatformAbsolutePath(argv0) && existsSync(argv0)) { |
| 84 | return argv0; |
| 85 | } |
| 86 | |
| 87 | const bunArgv0 = globalThis.Bun?.argv?.[0]?.trim(); |
| 88 | if (bunArgv0 && isCrossPlatformAbsolutePath(bunArgv0) && existsSync(bunArgv0)) { |
| 89 | return bunArgv0; |
| 90 | } |
| 91 | |
| 92 | return process.execPath; |
| 93 | } |
| 94 | |
| 95 | export function getHappyCliCommand(args: string[]): HappyCliCommand { |
| 96 | // Compiled binary mode: just use the executable directly |
no test coverage detected