MCPcopy Create free account
hub / github.com/agentforce314/clawcodex / update_project_entry

Function update_project_entry

src/config.py:326–348  ·  view source on GitHub ↗

Merge *updates* into ``projects[path]`` in the global config.

(
    project_path: str | Path, updates: dict[str, Any]
)

Source from the content-addressed store, hash-verified

324
325
326def update_project_entry(
327 project_path: str | Path, updates: dict[str, Any]
328) -> bool:
329 """Merge *updates* into ``projects[path]`` in the global config."""
330
331 path = _global_config_file()
332 config = _read_json(path)
333 projects = config.get(_PROJECTS_KEY)
334 if not isinstance(projects, dict):
335 projects = {}
336 key = normalize_path_for_config_key(project_path)
337 entry = projects.get(key)
338 if not isinstance(entry, dict):
339 entry = {}
340 entry.update(updates)
341 projects[key] = entry
342 config[_PROJECTS_KEY] = projects
343 try:
344 _atomic_write_json(path, config)
345 except OSError:
346 return False
347 _get_default_manager().invalidate()
348 return True
349
350
351# ---------------------------------------------------------------------------

Callers

nothing calls this directly

Calls 8

_global_config_fileFunction · 0.85
_atomic_write_jsonFunction · 0.85
_read_jsonFunction · 0.70
_get_default_managerFunction · 0.70
getMethod · 0.45
updateMethod · 0.45
invalidateMethod · 0.45

Tested by

no test coverage detected