mirror of
https://github.com/robbyrussell/oh-my-zsh.git
synced 2026-09-29 22:46:06 +02:00
fix(universalarchive): support 7zz and 7z for 7z archives (#14147)
This commit is contained in:
@@ -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}" ;;
|
||||
|
||||
Reference in New Issue
Block a user