(data: Record<string, unknown>)
| 21 | } |
| 22 | |
| 23 | export async function writeConfigFile(data: Record<string, unknown>): Promise<void> { |
| 24 | await ensureConfigDir(); |
| 25 | const path = getConfigPath(); |
| 26 | const tmp = path + '.tmp'; |
| 27 | writeFileSync(tmp, JSON.stringify(data, null, 2) + '\n', { mode: 0o600 }); |
| 28 | renameSync(tmp, path); |
| 29 | } |
| 30 | |
| 31 | export function loadConfig(flags: GlobalFlags): Config { |
| 32 | const file = readConfigFile(); |
no test coverage detected