( path: Option.Option<string>, options: FileOptionsReq )
| 2276 | const showConfirmation = FileConfirm.$is("Show") |
| 2277 | |
| 2278 | const resolveCurrentPath = ( |
| 2279 | path: Option.Option<string>, |
| 2280 | options: FileOptionsReq |
| 2281 | ): Effect.Effect<string, never, FileSystem.FileSystem> => { |
| 2282 | if (Option.isSome(path)) { |
| 2283 | return Effect.succeed(path.value) |
| 2284 | } |
| 2285 | if (Option.isSome(options.startingPath)) { |
| 2286 | const startingPath = options.startingPath.value |
| 2287 | return Effect.flatMap(FileSystem.FileSystem, (fs) => |
| 2288 | // Ensure the user provided starting path exists |
| 2289 | Effect.orDie(fs.exists(startingPath)).pipe( |
| 2290 | Effect.flatMap((exists) => |
| 2291 | exists ? Effect.void : Effect.die( |
| 2292 | `The provided starting path '${startingPath}' does not exist` |
| 2293 | ) |
| 2294 | ), |
| 2295 | Effect.as(startingPath) |
| 2296 | )) |
| 2297 | } |
| 2298 | return Effect.sync(() => process.cwd()) |
| 2299 | } |
| 2300 | |
| 2301 | const getFileList = Effect.fnUntraced(function*(directory: string, options: FileOptionsReq) { |
| 2302 | const fs = yield* FileSystem.FileSystem |
no test coverage detected