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

Fixes #2172
This commit is contained in:
ThanhNguyxn committed 2026-01-29 19:22:23 +07:00
1 parent 5f4715acfc
commit 23af14a32d
1 file changed
+3 -1
+3 -1
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);
});