File tree Expand file tree Collapse file tree
packages/opencode/src/bun Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import z from "zod"
22import { Global } from "../global"
33import { Log } from "../util/log"
44import path from "path"
5+ import { Filesystem } from "../util/filesystem"
56import { NamedError } from "@opencode-ai/util/error"
67import { readableStreamToText } from "bun"
78import { createRequire } from "module"
@@ -71,7 +72,10 @@ export namespace BunProc {
7172 await Bun . write ( pkgjson . name ! , JSON . stringify ( result , null , 2 ) )
7273 return result
7374 } )
74- if ( parsed . dependencies [ pkg ] === version ) return mod
75+ const dependencies = parsed . dependencies ?? { }
76+ if ( ! parsed . dependencies ) parsed . dependencies = dependencies
77+ const modExists = await Filesystem . exists ( mod )
78+ if ( dependencies [ pkg ] === version && modExists ) return mod
7579
7680 const proxied = ! ! (
7781 process . env . HTTP_PROXY ||
You can’t perform that action at this time.
0 commit comments