()
| 984 | } |
| 985 | |
| 986 | async function loadConfig() { |
| 987 | await ensureDirs() |
| 988 | if (!(await fileExists(configPath))) { |
| 989 | return |
| 990 | } |
| 991 | |
| 992 | try { |
| 993 | state.config = normalizeConfig(JSON.parse(await readFile(configPath, 'utf8'))) |
| 994 | } catch (error) { |
| 995 | pushLog( |
| 996 | 'ui', |
| 997 | `Failed to load config: ${error instanceof Error ? error.message : String(error)}`, |
| 998 | 'warn', |
| 999 | ) |
| 1000 | } |
| 1001 | } |
| 1002 | |
| 1003 | function normalizeWorkspaceDir(workspaceDir) { |
| 1004 | return resolve(workspaceDir || state.config.workspaceDir || rootDir) |
no test coverage detected