(filepath: string)
| 129 | ) |
| 130 | |
| 131 | const loadFile = (filepath: string): Effect.Effect<Info> => |
| 132 | Effect.gen(function* () { |
| 133 | // Silent-swallow non-NotFound read errors (perms, EISDIR, IO) → log + skip. |
| 134 | // Matches how parse/schema/plugin failures in load() are handled — every |
| 135 | // broken-config path degrades gracefully rather than crashing TUI startup. |
| 136 | const text = yield* afs.readFileStringSafe(filepath).pipe( |
| 137 | Effect.catchCause((cause) => |
| 138 | Effect.logWarning("failed to read tui config", { |
| 139 | path: filepath, |
| 140 | reason: FormatError(Cause.squash(cause)) ?? FormatUnknownError(Cause.squash(cause)), |
| 141 | }).pipe(Effect.as(undefined)), |
| 142 | ), |
| 143 | ) |
| 144 | if (!text) return {} as Info |
| 145 | yield* Effect.logInfo("loading tui config", { path: filepath }) |
| 146 | return yield* load(text, filepath) |
| 147 | }) |
| 148 | |
| 149 | const mergeFile = (acc: Acc, file: string) => |
| 150 | Effect.gen(function* () { |
no test coverage detected