Update packages/opencode/src/util/which.ts

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
opencode/quiet-pixel
Dax 2026-03-09 21:41:12 -04:00 committed by Dax Raad
parent e6bf83084c
commit c10b5880cc
1 changed files with 2 additions and 2 deletions

View File

@ -3,8 +3,8 @@ import path from "path"
import { Global } from "../global"
export function which(cmd: string, env?: NodeJS.ProcessEnv) {
const base = env?.PATH ?? env?.Path ?? process.env.PATH ?? process.env.Path
const full = base + path.delimiter + Global.Path.bin
const base = env?.PATH ?? env?.Path ?? process.env.PATH ?? process.env.Path ?? ""
const full = base ? base + path.delimiter + Global.Path.bin : Global.Path.bin
const result = whichPkg.sync(cmd, {
nothrow: true,
path: full,