fix(infra): use where on Windows for binary detection

Fixes #2172
This commit is contained in:
ThanhNguyxn 2026-01-26 19:21:57 +07:00
parent 5f4715acfc
commit 23af14a32d

View File

@ -7,7 +7,9 @@ export async function ensureBinary(
runtime: RuntimeEnv = defaultRuntime,
): Promise<void> {
// Abort early if a required CLI tool is missing.
await exec("which", [name]).catch(() => {
// Use `where` on Windows, `which` elsewhere.
const cmd = process.platform === "win32" ? "where" : "which";
await exec(cmd, [name]).catch(() => {
runtime.error(`Missing required binary: ${name}. Please install it.`);
runtime.exit(1);
});