(body: (fixture: Awaited<ReturnType<typeof gitRemote>>) => Effect.Effect<A, E, R>)
| 94 | } |
| 95 | |
| 96 | function withRemote<A, E, R>(body: (fixture: Awaited<ReturnType<typeof gitRemote>>) => Effect.Effect<A, E, R>) { |
| 97 | return Effect.acquireUseRelease( |
| 98 | Effect.promise(async () => { |
| 99 | const root = await tmpdir() |
| 100 | return { root, fixture: await gitRemote(root.path) } |
| 101 | }), |
| 102 | (input) => body(input.fixture), |
| 103 | (input) => Effect.promise(() => input.root[Symbol.asyncDispose]()), |
| 104 | ) |
| 105 | } |
| 106 | |
| 107 | function read(file: string) { |
| 108 | return Effect.promise(() => fs.readFile(file, "utf8")).pipe(Effect.map((content) => content.replace(/\r\n/g, "\n"))) |
no test coverage detected