Merge *updates* into ``projects[path]`` in the global config.
(
project_path: str | Path, updates: dict[str, Any]
)
| 324 | |
| 325 | |
| 326 | def 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 | # --------------------------------------------------------------------------- |
nothing calls this directly
no test coverage detected