| 577 | })) |
| 578 | |
| 579 | const writeMarkdown = (files: ReadonlyArray<Domain.File>) => |
| 580 | Effect.gen(function*() { |
| 581 | const config = yield* Configuration.Configuration |
| 582 | const fileSystem = yield* FileSystem.FileSystem |
| 583 | const path = yield* Path.Path.pipe(Effect.provide(NodePath.layerPosix)) |
| 584 | const pattern = path.normalize(path.join(config.outDir, "**/*.ts.md")) |
| 585 | yield* Effect.logDebug(`Deleting ${chalk.black(pattern)}...`) |
| 586 | const paths = yield* glob(pattern) |
| 587 | yield* Effect.forEach(paths, (path) => fileSystem.remove(path, { recursive: true }), { |
| 588 | concurrency: "unbounded" |
| 589 | }) |
| 590 | return yield* writeFilesToOutDir(files) |
| 591 | }) |
| 592 | |
| 593 | /** @internal */ |
| 594 | export const program = Effect.gen(function*() { |