feat(template): cleanup-after-update + ruff fixes

Move disk cleanup out of the Windows Update loop:
- PS scripts: extract Invoke-DiskCleanup function, add -CleanupOnly switch
  for standalone post-update cleanup pass.
- Python command: always pass -SkipCleanup:$true during WU loop; after
  loop exits 0, run a separate -CleanupOnly invocation (skipped if
  --skip-cleanup). Fails fast if cleanup-only returns nonzero.
- Tests: 3 new tests for cleanup-runs-after-loop, skip-cleanup suppresses
  it, and cleanup-failure propagates as ClickException.
- ruff --fix: remove unused shutil import, sort imports, fix UP037/UP035.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-24 02:41:15 +02:00
parent d5f362b8dc
commit f96b9953c5
6 changed files with 356 additions and 225 deletions
+1 -1
View File
@@ -39,9 +39,9 @@ from __future__ import annotations
import json
import time
from collections.abc import Generator
from contextlib import contextmanager
from pathlib import Path
from typing import Generator
class IpSlotPool: