()
| 21 | * Load global configuration from ~/.config/tianji/config.json |
| 22 | */ |
| 23 | export async function loadGlobalConfig(): Promise<GlobalConfig | null> { |
| 24 | try { |
| 25 | if (await fs.pathExists(GLOBAL_CONFIG_PATH)) { |
| 26 | const config = await fs.readJson(GLOBAL_CONFIG_PATH); |
| 27 | return config; |
| 28 | } |
| 29 | return null; |
| 30 | } catch (error) { |
| 31 | console.error('Error loading global config:', error); |
| 32 | return null; |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | /** |
| 37 | * Save global configuration to ~/.config/tianji/config.json |
no test coverage detected