File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
packages/opencode/src/bun Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { Log } from "../util/log"
44import path from "path"
55import { NamedError } from "../util/error"
66import { readableStreamToText } from "bun"
7+ import { Lock } from "../util/lock"
78
89export namespace BunProc {
910 const log = Log . create ( { service : "bun" } )
@@ -58,6 +59,9 @@ export namespace BunProc {
5859 )
5960
6061 export async function install ( pkg : string , version = "latest" ) {
62+ // Use lock to ensure only one install at a time
63+ using _ = await Lock . write ( "bun-install" )
64+
6165 const mod = path . join ( Global . Path . cache , "node_modules" , pkg )
6266 const pkgjson = Bun . file ( path . join ( Global . Path . cache , "package.json" ) )
6367 const parsed = await pkgjson . json ( ) . catch ( async ( ) => {
You can’t perform that action at this time.
0 commit comments