()
| 92 | configFile = path.join(configDir, "config.json"); |
| 93 | } |
| 94 | return configFile; |
| 95 | } |
| 96 | |
| 97 | function loadConfig(): NeZhaConfig | null { |
| 98 | if (configCache) return configCache; |
| 99 | try { |
| 100 | const file = getConfigPath(); |
| 101 | if (fs.existsSync(file)) { |
| 102 | const content = fs.readFileSync(file, "utf-8"); |
| 103 | configCache = JSON.parse(content); |
| 104 | return configCache; |
| 105 | } |
| 106 | } catch {} |
| 107 | return null; |
| 108 | } |
no test coverage detected