MCPcopy
hub / github.com/anomalyco/opencode / withGlobalConfig

Function withGlobalConfig

packages/opencode/test/config/config.test.ts:183–191  ·  view source on GitHub ↗
(
  input: { config?: object; name?: string },
  fn: (input: { dir: string }) => Effect.Effect<A, E, R>,
)

Source from the content-addressed store, hash-verified

181 )
182
183const withGlobalConfig = <A, E, R>(
184 input: { config?: object; name?: string },
185 fn: (input: { dir: string }) => Effect.Effect<A, E, R>,
186) =>
187 Effect.gen(function* () {
188 const dir = yield* tmpdirScoped()
189 if (input.config) yield* writeConfigEffect(dir, schemaConfig(input.config), input.name)
190 return yield* withGlobalConfigDir(dir, fn({ dir }))
191 })
192
193const withConfigTree = <A, E, R>(
194 input: { global?: object; project?: object; local?: object },

Callers 1

config.test.tsFile · 0.85

Calls 5

tmpdirScopedFunction · 0.90
writeConfigEffectFunction · 0.85
schemaConfigFunction · 0.85
withGlobalConfigDirFunction · 0.85
fnFunction · 0.50

Tested by

no test coverage detected