refactor(opencode): replace Bun.which with npm which (#15012)

This commit is contained in:
Dax
2026-03-06 00:18:29 -05:00
committed by GitHub
parent cb411248bf
commit 74effa8eec
11 changed files with 190 additions and 77 deletions

View File

@@ -0,0 +1,10 @@
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,
})
return typeof result === "string" ? result : null
}