Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugins/universalarchive/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` |
Expand Down
12 changes: 11 additions & 1 deletion plugins/universalarchive/universalarchive.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -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}" ;;
Expand Down
Loading