fix(universalarchive): support 7zz and 7z for 7z archives (#14147)

This commit is contained in:
ca0904
2026-09-29 17:38:41 +02:00
committed by GitHub
parent 92bf53f1ae
commit 4d4cfc287e
2 changed files with 12 additions and 2 deletions
+1 -1
View File
@@ -52,7 +52,7 @@ The plugin will generate a default archive filename based on the input:
| Format | Description | Tool Used |
|:-----------------|:-------------------------------|:-----------------|
| `7z` | 7zip archive | `7z` |
| `7z` | 7zip archive | `7zz`,`7z`,`7za` |
| `bz2` | Bzip2-compressed file | `bzip2` |
| `gz` | Gzip-compressed file | `gzip` |
| `lzma` | LZMA-compressed file | `lzma` |
@@ -49,7 +49,17 @@ tlz (tar.lzma), txz (tar.xz), tZ (tar.Z), xz, Z, zip, and zst."
fi
case "$ext" in
7z) 7z u "${output}" "${@}" ;;
7z)
if (( $+commands[7zz] )); then
7zz u "${output}" "${@}"
elif (( $+commands[7z] )); then
7z u "${output}" "${@}"
elif (( $+commands[7za] )); then
7za u "${output}" "${@}"
else
echo "ua: cannot create 7z files: install 7zz, 7z or 7za" >&2
return 1
fi ;;
bz2) bzip2 -vcf "${@}" > "${output}" ;;
gz) gzip -vcf "${@}" > "${output}" ;;
lzma) lzma -vc -T0 "${@}" > "${output}" ;;