Delete a backup file.
(filename: str)
| 353 | |
| 354 | |
| 355 | def delete_backup(filename: str) -> None: |
| 356 | """Delete a backup file.""" |
| 357 | backup_dir = get_backup_dir() |
| 358 | backup_file = backup_dir / filename |
| 359 | |
| 360 | if not backup_file.exists(): |
| 361 | raise FileNotFoundError(f"Backup file not found: {filename}") |
| 362 | |
| 363 | if not backup_file.is_file(): |
| 364 | raise ValueError(f"Invalid backup file: {filename}") |
| 365 | |
| 366 | backup_file.unlink() |
| 367 | logger.info(f"Deleted backup: {filename}") |
nothing calls this directly
no test coverage detected