(body: (fixture: Awaited<ReturnType<typeof gitRemote>>) => Effect.Effect<A, E, R>)
| 56 | }) |
| 57 | |
| 58 | function withRemote<A, E, R>(body: (fixture: Awaited<ReturnType<typeof gitRemote>>) => Effect.Effect<A, E, R>) { |
| 59 | return Effect.acquireUseRelease( |
| 60 | Effect.promise(async () => { |
| 61 | const root = await tmpdir() |
| 62 | return { root, fixture: await gitRemote(root.path) } |
| 63 | }), |
| 64 | (input) => body(input.fixture), |
| 65 | (input) => Effect.promise(() => input.root[Symbol.asyncDispose]()), |
| 66 | ) |
| 67 | } |
| 68 | |
| 69 | function read(file: string) { |
| 70 | return Effect.promise(() => fs.readFile(file, "utf8")).pipe(Effect.map((content) => content.replace(/\r\n/g, "\n"))) |
no test coverage detected