()
| 1352 | let configReadingAllowed = false |
| 1353 | |
| 1354 | export function enableConfigs(): void { |
| 1355 | if (configReadingAllowed) { |
| 1356 | // Ensure this is idempotent |
| 1357 | return |
| 1358 | } |
| 1359 | |
| 1360 | const startTime = Date.now() |
| 1361 | logForDiagnosticsNoPII('info', 'enable_configs_started') |
| 1362 | |
| 1363 | // Any reads to configuration before this flag is set show an console warning |
| 1364 | // to prevent us from adding config reading during module initialization |
| 1365 | configReadingAllowed = true |
| 1366 | // We only check the global config because currently all the configs share a file |
| 1367 | getConfig( |
| 1368 | getGlobalClaudeFile(), |
| 1369 | createDefaultGlobalConfig, |
| 1370 | true /* throw on invalid */, |
| 1371 | ) |
| 1372 | |
| 1373 | logForDiagnosticsNoPII('info', 'enable_configs_completed', { |
| 1374 | duration_ms: Date.now() - startTime, |
| 1375 | }) |
| 1376 | } |
| 1377 | |
| 1378 | /** |
| 1379 | * Returns the directory where config backup files are stored. |
no test coverage detected