mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
feat: add bun_no_cache configuration option to disable Bun cache during package installation
This commit is contained in:
parent
0569e8652c
commit
0adc76a1db
2 changed files with 11 additions and 0 deletions
|
|
@ -4,6 +4,7 @@ import { Log } from "../util/log"
|
|||
import path from "path"
|
||||
import { NamedError } from "@opencode-ai/util/error"
|
||||
import { readableStreamToText } from "bun"
|
||||
import { Config } from "../config/config"
|
||||
import { createRequire } from "module"
|
||||
import { Lock } from "../util/lock"
|
||||
|
||||
|
|
@ -76,6 +77,12 @@ export namespace BunProc {
|
|||
// Build command arguments
|
||||
const args = ["add", "--force", "--exact", "--cwd", Global.Path.cache, pkg + "@" + version]
|
||||
|
||||
// Add --no-cache flag if configured
|
||||
const config = await Config.get()
|
||||
if (config.bun_no_cache) {
|
||||
args.push("--no-cache")
|
||||
}
|
||||
|
||||
// Let Bun handle registry resolution:
|
||||
// - If .npmrc files exist, Bun will use them automatically
|
||||
// - If no .npmrc files exist, Bun will default to https://registry.npmjs.org
|
||||
|
|
|
|||
|
|
@ -671,6 +671,10 @@ export namespace Config {
|
|||
url: z.string().optional().describe("Enterprise URL"),
|
||||
})
|
||||
.optional(),
|
||||
bun_no_cache: z
|
||||
.boolean()
|
||||
.optional()
|
||||
.describe("Disable Bun cache when installing packages (adds --no-cache flag)"),
|
||||
experimental: z
|
||||
.object({
|
||||
hook: z
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue