From c10b5880cc65721d7fbfbfd29e6e14d05e7604aa Mon Sep 17 00:00:00 2001 From: Dax Date: Mon, 9 Mar 2026 21:41:12 -0400 Subject: [PATCH] Update packages/opencode/src/util/which.ts Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --- packages/opencode/src/util/which.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/opencode/src/util/which.ts b/packages/opencode/src/util/which.ts index 225763081c..2e40739148 100644 --- a/packages/opencode/src/util/which.ts +++ b/packages/opencode/src/util/which.ts @@ -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,