summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--packages/opencode/src/bun/index.ts18
1 files changed, 17 insertions, 1 deletions
diff --git a/packages/opencode/src/bun/index.ts b/packages/opencode/src/bun/index.ts
index 55bbf7b41..fe2f0dec3 100644
--- a/packages/opencode/src/bun/index.ts
+++ b/packages/opencode/src/bun/index.ts
@@ -73,8 +73,24 @@ export namespace BunProc {
})
if (parsed.dependencies[pkg] === version) return mod
+ const proxied = !!(
+ process.env.HTTP_PROXY ||
+ process.env.HTTPS_PROXY ||
+ process.env.http_proxy ||
+ process.env.https_proxy
+ )
+
// Build command arguments
- const args = ["add", "--force", "--exact", "--cwd", Global.Path.cache, pkg + "@" + version]
+ const args = [
+ "add",
+ "--force",
+ "--exact",
+ // TODO: get rid of this case (see: https://github.com/oven-sh/bun/issues/19936)
+ ...(proxied ? ["--no-cache"] : []),
+ "--cwd",
+ Global.Path.cache,
+ pkg + "@" + version,
+ ]
// Let Bun handle registry resolution:
// - If .npmrc files exist, Bun will use them automatically