MCPcopy Create free account
hub / github.com/tiann/hapi / resolveHappyCliExecutable

Function resolveHappyCliExecutable

cli/src/utils/spawnHappyCLI.ts:76–93  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

74}
75
76export 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
95export function getHappyCliCommand(args: string[]): HappyCliCommand {
96 // Compiled binary mode: just use the executable directly

Callers 2

getHappyCliCommandFunction · 0.85

Calls 1

Tested by

no test coverage detected