()
| 240 | } |
| 241 | |
| 242 | export const ensureSettingsExists = (): void => { |
| 243 | const configDir = getConfigBaseDir() |
| 244 | const settingsPath = getSettingsFilePath() |
| 245 | const defaultsPath = getDefaultSettingsFilePath() |
| 246 | |
| 247 | if (!fs.existsSync(configDir)) { |
| 248 | fs.mkdirSync(configDir, { recursive: true }) |
| 249 | } |
| 250 | |
| 251 | if (!fs.existsSync(settingsPath)) { |
| 252 | fs.copyFileSync(defaultsPath, settingsPath) |
| 253 | } |
| 254 | } |
| 255 | |
| 256 | export const loadDefaults = (): Settings => { |
| 257 | const defaultsRaw = fs.readFileSync(getDefaultSettingsFilePath(), 'utf-8') |
no test coverage detected