Address Copilot PR review: reject unknown archive formats, fix case-sensitive check

- Add explanatory comment to empty except KeyError block in _extract_workflow_yml
- Use case-insensitive extension matching for local archive detection in workflow add
- Reject unknown archive formats with clear error messages instead of silently
  defaulting to ZIP in preset add --from, extension add --from, download_extension(),
  and download_pack()
This commit is contained in:
Manfred Riem
2026-05-06 07:03:57 -05:00
parent 0c6cc4502c
commit c44cc245ed
3 changed files with 22 additions and 2 deletions

View File

@@ -2151,6 +2151,11 @@ class ExtensionCatalog:
raise ExtensionError(f"Failed to save extension archive: {e}")
# Choose file extension based on detected format.
if not archive_fmt:
raise ExtensionError(
f"Could not determine archive format for {download_url}. "
"Ensure the URL points to a .zip or .tar.gz file."
)
if archive_fmt == "tar.gz":
archive_filename = f"{extension_id}-{version}.tar.gz"
else: