(directory: string, filesystemLayer = LayerNode.compile(FSUtil.node))
| 14 | import { it } from "./lib/effect" |
| 15 | |
| 16 | function provide(directory: string, filesystemLayer = LayerNode.compile(FSUtil.node)) { |
| 17 | const activeLocation = Layer.succeed( |
| 18 | Location.Service, |
| 19 | Location.Service.of(location({ directory: AbsolutePath.make(directory) })), |
| 20 | ) |
| 21 | return Effect.provide( |
| 22 | AppNodeBuilder.build(LayerNode.group([LocationMutation.node, FileMutation.node]), [ |
| 23 | [Location.node, activeLocation], |
| 24 | [FSUtil.node, filesystemLayer], |
| 25 | ]), |
| 26 | ) |
| 27 | } |
| 28 | |
| 29 | function withTmp<A, E, R>(f: (directory: string) => Effect.Effect<A, E, R>) { |
| 30 | return Effect.acquireRelease( |
no test coverage detected