(
input: { global?: object; project?: object; local?: object },
effect: Effect.Effect<A, E, R>,
)
| 191 | }) |
| 192 | |
| 193 | const withConfigTree = <A, E, R>( |
| 194 | input: { global?: object; project?: object; local?: object }, |
| 195 | effect: Effect.Effect<A, E, R>, |
| 196 | ) => |
| 197 | Effect.gen(function* () { |
| 198 | const root = yield* tmpdirScoped() |
| 199 | const global = yield* tmpdirScoped() |
| 200 | const directory = path.join(root, "project") |
| 201 | yield* Effect.all( |
| 202 | [ |
| 203 | input.global ? writeConfigEffect(global, schemaConfig(input.global)) : undefined, |
| 204 | input.project ? writeConfigEffect(directory, schemaConfig(input.project)) : undefined, |
| 205 | input.local ? writeConfigEffect(path.join(directory, ".opencode"), schemaConfig(input.local)) : undefined, |
| 206 | ].filter((effect): effect is Effect.Effect<void, FSUtil.Error, FSUtil.Service> => effect !== undefined), |
| 207 | { concurrency: "unbounded" }, |
| 208 | ) |
| 209 | return yield* withGlobalConfigDir(global, withInstanceDir(directory, effect)) |
| 210 | }) |
| 211 | |
| 212 | const wellKnown = (input: { |
| 213 | authUrl?: string |
no test coverage detected