mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-23 04:26:05 +00:00
chore: generate
This commit is contained in:
parent
231689c767
commit
9ecb04e35b
1 changed files with 14 additions and 15 deletions
|
|
@ -126,10 +126,7 @@ function withProcessEnv<A, E, R>(key: string, value: string | undefined, effect:
|
|||
return withProcessEnvs({ [key]: value }, effect)
|
||||
}
|
||||
|
||||
function withProcessEnvs<A, E, R>(
|
||||
entries: Record<string, string | undefined>,
|
||||
effect: Effect.Effect<A, E, R>,
|
||||
) {
|
||||
function withProcessEnvs<A, E, R>(entries: Record<string, string | undefined>, effect: Effect.Effect<A, E, R>) {
|
||||
return Effect.acquireUseRelease(
|
||||
Effect.sync(() => {
|
||||
const originals: Record<string, string | undefined> = {}
|
||||
|
|
@ -1960,17 +1957,19 @@ describe("OPENCODE_DISABLE_PROJECT_CONFIG", () => {
|
|||
{ config: { instructions: ["./CUSTOM.md"] } },
|
||||
)
|
||||
|
||||
it.instance("OPENCODE_CONFIG_DIR still works when flag is set", () =>
|
||||
Effect.gen(function* () {
|
||||
const configDir = yield* tmpdirScoped({ config: { model: "configdir/model" } })
|
||||
yield* withProcessEnvs(
|
||||
{ OPENCODE_DISABLE_PROJECT_CONFIG: "true", OPENCODE_CONFIG_DIR: configDir },
|
||||
Effect.gen(function* () {
|
||||
const config = yield* Config.use.get()
|
||||
expect(config.model).toBe("configdir/model")
|
||||
}),
|
||||
)
|
||||
}),
|
||||
it.instance(
|
||||
"OPENCODE_CONFIG_DIR still works when flag is set",
|
||||
() =>
|
||||
Effect.gen(function* () {
|
||||
const configDir = yield* tmpdirScoped({ config: { model: "configdir/model" } })
|
||||
yield* withProcessEnvs(
|
||||
{ OPENCODE_DISABLE_PROJECT_CONFIG: "true", OPENCODE_CONFIG_DIR: configDir },
|
||||
Effect.gen(function* () {
|
||||
const config = yield* Config.use.get()
|
||||
expect(config.model).toBe("configdir/model")
|
||||
}),
|
||||
)
|
||||
}),
|
||||
{ config: { model: "project/model" } },
|
||||
)
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue