File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ export namespace Global {
1818 return process . env . OPENCODE_TEST_HOME || os . homedir ( )
1919 } ,
2020 data,
21- bin : path . join ( data , "bin" ) ,
21+ bin : path . join ( cache , "bin" ) ,
2222 log : path . join ( data , "log" ) ,
2323 cache,
2424 config,
Original file line number Diff line number Diff line change 11import whichPkg from "which"
2+ import path from "path"
3+ import { Global } from "../global"
24
35export function which ( cmd : string , env ?: NodeJS . ProcessEnv ) {
6+ const base = env ?. PATH ?? env ?. Path ?? process . env . PATH ?? process . env . Path ?? ""
7+ const full = base ? base + path . delimiter + Global . Path . bin : Global . Path . bin
48 const result = whichPkg . sync ( cmd , {
59 nothrow : true ,
6- path : env ?. PATH ?? env ?. Path ?? process . env . PATH ?? process . env . Path ,
10+ path : full ,
711 pathExt : env ?. PATHEXT ?? env ?. PathExt ?? process . env . PATHEXT ?? process . env . PathExt ,
812 } )
913 return typeof result === "string" ? result : null
You can’t perform that action at this time.
0 commit comments