()
| 62 | } |
| 63 | |
| 64 | export async function readSettings(): Promise<Settings> { |
| 65 | if (!existsSync(configuration.settingsFile)) { |
| 66 | return { ...defaultSettings } |
| 67 | } |
| 68 | |
| 69 | try { |
| 70 | const content = await readFile(configuration.settingsFile, 'utf8') |
| 71 | return JSON.parse(content) |
| 72 | } catch { |
| 73 | return { ...defaultSettings } |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | export async function writeSettings(settings: Settings): Promise<void> { |
| 78 | if (!existsSync(configuration.happyHomeDir)) { |
no outgoing calls
no test coverage detected