From 1c36bec970131396b1caffbf27070970d52b0b12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Burak=20Sormage=C3=A7?= Date: Wed, 11 Feb 2026 23:28:53 -0500 Subject: [PATCH] Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/hooks/config.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/hooks/config.ts b/src/hooks/config.ts index e0c7855cf63..0d9176a152d 100644 --- a/src/hooks/config.ts +++ b/src/hooks/config.ts @@ -68,7 +68,15 @@ export function resolveRuntimePlatform(): string { export function hasBinary(bin: string): boolean { const pathEnv = process.env.PATH ?? ""; const parts = pathEnv.split(path.delimiter).filter(Boolean); - const extensions = process.platform === "win32" ? [".exe", ".cmd", ".bat", ""] : [""]; + const extensions = + process.platform === "win32" + ? [ + "", + ...(process.env.PATHEXT ?? ".EXE;.CMD;.BAT;.COM") + .split(";") + .filter(Boolean), + ] + : [""]; for (const part of parts) { for (const ext of extensions) { const candidate = path.join(part, bin + ext);