From b98697238b014bd237da2b2db5dd6053d4c777a0 Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Sat, 7 Feb 2026 18:48:14 +0900 Subject: [PATCH] fix: use platform-aware binary detection (where on Windows, which on Unix) --- src/cli/doctor/checks/gh.test.ts | 2 +- src/cli/doctor/checks/gh.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cli/doctor/checks/gh.test.ts b/src/cli/doctor/checks/gh.test.ts index 23593e5e7..4d989dad5 100644 --- a/src/cli/doctor/checks/gh.test.ts +++ b/src/cli/doctor/checks/gh.test.ts @@ -29,7 +29,7 @@ describe("gh cli check", () => { it("returns gh cli info structure", async () => { const spawnSpy = spyOn(Bun, "spawn").mockImplementation((cmd) => { - if (Array.isArray(cmd) && cmd[0] === "which" && cmd[1] === "gh") { + if (Array.isArray(cmd) && (cmd[0] === "which" || cmd[0] === "where") && cmd[1] === "gh") { return createProc({ stdout: "/usr/bin/gh\n" }) } diff --git a/src/cli/doctor/checks/gh.ts b/src/cli/doctor/checks/gh.ts index 06b2ca8ef..af7ade8e3 100644 --- a/src/cli/doctor/checks/gh.ts +++ b/src/cli/doctor/checks/gh.ts @@ -13,7 +13,8 @@ export interface GhCliInfo { async function checkBinaryExists(binary: string): Promise<{ exists: boolean; path: string | null }> { try { - const proc = Bun.spawn(["which", binary], { stdout: "pipe", stderr: "pipe" }) + const whichCmd = process.platform === "win32" ? "where" : "which" + const proc = Bun.spawn([whichCmd, binary], { stdout: "pipe", stderr: "pipe" }) const output = await new Response(proc.stdout).text() await proc.exited if (proc.exitCode === 0) {