We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bcea8ed commit 768c81cCopy full SHA for 768c81c
1 file changed
packages/opencode/src/bun/index.ts
@@ -4,6 +4,7 @@ import { Log } from "../util/log"
4
import path from "path"
5
import { NamedError } from "../util/error"
6
import { readableStreamToText } from "bun"
7
+import { Lock } from "../util/lock"
8
9
export namespace BunProc {
10
const log = Log.create({ service: "bun" })
@@ -58,6 +59,9 @@ export namespace BunProc {
58
59
)
60
61
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
+
65
const mod = path.join(Global.Path.cache, "node_modules", pkg)
66
const pkgjson = Bun.file(path.join(Global.Path.cache, "package.json"))
67
const parsed = await pkgjson.json().catch(async () => {
0 commit comments