(path: Path, versions: dict[str, str])
| 286 | |
| 287 | |
| 288 | def write_versions_file(path: Path, versions: dict[str, str]) -> None: |
| 289 | try: |
| 290 | path.parent.mkdir(parents=True, exist_ok=True) |
| 291 | with open(path, "w", encoding="utf-8") as f: |
| 292 | json.dump({"versions": versions}, f, ensure_ascii=False, indent=4) |
| 293 | print(Console.ok(t("inf_write_version_file", path=path))) |
| 294 | print(Console.info(t("inf_current_versions", versions=versions))) |
| 295 | except Exception as e: |
| 296 | print(Console.warn(t("wrn_write_version_failed", error=e))) |
| 297 | |
| 298 | |
| 299 | def _retry_on_permission(operation, *, error_key: str = "", **fmt_args) -> bool: |
no test coverage detected