(path: string)
| 483 | }; |
| 484 | |
| 485 | const readSettings = (path: string): Effected<Logging | ReadFile, Settings> => |
| 486 | effected(function* () { |
| 487 | const content = yield* readFile(path); |
| 488 | try { |
| 489 | const settings = JSON.parse(content); |
| 490 | yield* logger.log("Settings loaded"); |
| 491 | return settings; |
| 492 | } catch (e) { |
| 493 | yield* logger.error("Failed to parse settings file:", e); |
| 494 | return defaultSettings; |
| 495 | } |
| 496 | }); |
| 497 | |
| 498 | const readSettingsWithoutLogging = (path: string) => |
| 499 | readSettings(path).resume( |
no test coverage detected