(
init: (dir: string) => Promise<T>,
body: (tmp: { path: string; extra: T }) => Effect.Effect<A, E, R>,
)
| 26 | ) |
| 27 | |
| 28 | function withTmp<T, A, E, R>( |
| 29 | init: (dir: string) => Promise<T>, |
| 30 | body: (tmp: { path: string; extra: T }) => Effect.Effect<A, E, R>, |
| 31 | ) { |
| 32 | return Effect.gen(function* () { |
| 33 | const dir = yield* tmpdirScoped() |
| 34 | const extra = yield* Effect.promise(() => init(dir)) |
| 35 | return yield* body({ path: dir, extra }) |
| 36 | }) |
| 37 | } |
| 38 | |
| 39 | function load(dir: string, flags?: Parameters<typeof RuntimeFlags.layer>[0]) { |
| 40 | const source = path.join(dir, "opencode.json") |
no test coverage detected