summaryrefslogtreecommitdiff
path: root/plugins/extract/extract.plugin.zsh
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/extract/extract.plugin.zsh')
-rw-r--r--plugins/extract/extract.plugin.zsh18
1 files changed, 13 insertions, 5 deletions
diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh
index 88d8b0740..aed77e7d7 100644
--- a/plugins/extract/extract.plugin.zsh
+++ b/plugins/extract/extract.plugin.zsh
@@ -70,24 +70,32 @@ EOF
(*.tar.lz4) lz4 -c -d "$full_path" | tar xvf - ;;
(*.tar.lrz) (( $+commands[lrzuntar] )) && lrzuntar "$full_path" ;;
(*.gz) (( $+commands[pigz] )) && pigz -cdk "$full_path" > "${file:t:r}" || gunzip -ck "$full_path" > "${file:t:r}" ;;
- (*.bz2) bunzip2 "$full_path" ;;
+ (*.bz2) (( $+commands[pbzip2] )) && pbzip2 -d "$full_path" || bunzip2 "$full_path" ;;
(*.xz) unxz "$full_path" ;;
(*.lrz) (( $+commands[lrunzip] )) && lrunzip "$full_path" ;;
(*.lz4) lz4 -d "$full_path" ;;
(*.lzma) unlzma "$full_path" ;;
(*.z) uncompress "$full_path" ;;
- (*.zip|*.war|*.jar|*.ear|*.sublime-package|*.ipa|*.ipsw|*.xpi|*.apk|*.aar|*.whl) unzip "$full_path" ;;
- (*.rar) unrar x -ad "$full_path" ;;
+ (*.zip|*.war|*.jar|*.ear|*.sublime-package|*.ipa|*.ipsw|*.xpi|*.apk|*.aar|*.whl|*.vsix|*.crx|*.pk3|*.pk4) unzip "$full_path" ;;
+ (*.rar)
+ if (( $+commands[unrar] )); then
+ unrar x -ad "$full_path"
+ elif (( $+commands[unar] )); then
+ unar -o . "$full_path"
+ else
+ echo "extract: cannot extract RAR files: install unrar or unar" >&2
+ success=1
+ fi ;;
(*.rpm)
rpm2cpio "$full_path" | cpio --quiet -id ;;
- (*.7z) 7za x "$full_path" ;;
+ (*.7z | *.7z.[0-9]* | *.pk7) 7za x "$full_path" ;;
(*.deb)
command mkdir -p "control" "data"
ar vx "$full_path" > /dev/null
builtin cd -q control; extract ../control.tar.*
builtin cd -q ../data; extract ../data.tar.*
builtin cd -q ..; command rm *.tar.* debian-binary ;;
- (*.zst) unzstd "$full_path" ;;
+ (*.zst) unzstd --stdout "$full_path" > "${file:t:r}" ;;
(*.cab|*.exe) cabextract "$full_path" ;;
(*.cpio|*.obscpio) cpio -idmvF "$full_path" ;;
(*.zpaq) zpaq x "$full_path" ;;