( path: Option.Option<string>, options: FileOptionsReq )
| 2114 | const showConfirmation = Confirm.$is("Show") |
| 2115 | |
| 2116 | const resolveCurrentPath = ( |
| 2117 | path: Option.Option<string>, |
| 2118 | options: FileOptionsReq |
| 2119 | ): Effect.Effect<string, never, FileSystem.FileSystem> => { |
| 2120 | if (Option.isSome(path)) { |
| 2121 | return Effect.succeed(path.value) |
| 2122 | } |
| 2123 | if (Option.isSome(options.startingPath)) { |
| 2124 | const startingPath = options.startingPath.value |
| 2125 | return Effect.flatMap(FileSystem.FileSystem, (fs) => |
| 2126 | // Ensure the user provided starting path exists |
| 2127 | Effect.orDie(fs.exists(startingPath)).pipe( |
| 2128 | Effect.flatMap((exists) => |
| 2129 | exists ? Effect.void : Effect.die( |
| 2130 | `The provided starting path '${startingPath}' does not exist` |
| 2131 | ) |
| 2132 | ), |
| 2133 | Effect.as(startingPath) |
| 2134 | )) |
| 2135 | } |
| 2136 | return Effect.sync(() => process.cwd()) |
| 2137 | } |
| 2138 | |
| 2139 | const getFileList = Effect.fnUntraced(function*(directory: string, options: FileOptionsReq) { |
| 2140 | const fs = yield* FileSystem.FileSystem |
no test coverage detected