summaryrefslogtreecommitdiffhomepage
path: root/packages/opencode/src/util/which.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/opencode/src/util/which.ts')
-rw-r--r--packages/opencode/src/util/which.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/opencode/src/util/which.ts b/packages/opencode/src/util/which.ts
index 78e651e8e..81da25721 100644
--- a/packages/opencode/src/util/which.ts
+++ b/packages/opencode/src/util/which.ts
@@ -3,8 +3,8 @@ import whichPkg from "which"
export function which(cmd: string, env?: NodeJS.ProcessEnv) {
const result = whichPkg.sync(cmd, {
nothrow: true,
- path: env?.PATH,
- pathExt: env?.PATHEXT,
+ path: env?.PATH ?? env?.Path ?? process.env.PATH ?? process.env.Path,
+ pathExt: env?.PATHEXT ?? env?.PathExt ?? process.env.PATHEXT ?? process.env.PathExt,
})
return typeof result === "string" ? result : null
}