MCPcopy Create free account
hub / github.com/Work-Fisher/code-claw / loadConfig

Function loadConfig

tools/claw-launcher-ui/server.mjs:986–1001  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

984}
985
986async 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
1003function normalizeWorkspaceDir(workspaceDir) {
1004 return resolve(workspaceDir || state.config.workspaceDir || rootDir)

Callers 1

mainFunction · 0.85

Calls 6

ensureDirsFunction · 0.85
fileExistsFunction · 0.85
normalizeConfigFunction · 0.85
readFileFunction · 0.85
pushLogFunction · 0.85
parseMethod · 0.45

Tested by

no test coverage detected