summaryrefslogtreecommitdiff
path: root/plugins/extract/extract.plugin.zsh
diff options
context:
space:
mode:
authorFilipe Nascimento <flipee@tuta.io>2019-12-17 13:35:40 -0300
committerMarc Cornellà <marc.cornella@live.com>2019-12-17 17:35:40 +0100
commit1761685d3e8d0594ff580c968874665e64a9a9cb (patch)
tree4fc73617ebbf50b370e539bac616082933dc58fc /plugins/extract/extract.plugin.zsh
parent664664f6cd8a1c02a38063c8f2104f0515a19399 (diff)
downloadzsh-1761685d3e8d0594ff580c968874665e64a9a9cb.tar.gz
zsh-1761685d3e8d0594ff580c968874665e64a9a9cb.tar.bz2
zsh-1761685d3e8d0594ff580c968874665e64a9a9cb.zip
extract: add zstd support (#8469)
Diffstat (limited to 'plugins/extract/extract.plugin.zsh')
-rw-r--r--plugins/extract/extract.plugin.zsh5
1 files changed, 5 insertions, 0 deletions
diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh
index 27b9e50f1..b7d4e3ba7 100644
--- a/plugins/extract/extract.plugin.zsh
+++ b/plugins/extract/extract.plugin.zsh
@@ -40,6 +40,10 @@ extract() {
tar --lzma --help &> /dev/null \
&& tar --lzma -xvf "$1" \
|| lzcat "$1" | tar xvf - ;;
+ (*.tar.zst|*.tzst)
+ tar --zstd --help &> /dev/null \
+ && tar --zstd -xvf "$1" \
+ || zstdcat "$1" | tar xvf - ;;
(*.tar) tar xvf "$1" ;;
(*.gz) (( $+commands[pigz] )) && pigz -dk "$1" || gunzip -k "$1" ;;
(*.bz2) bunzip2 "$1" ;;
@@ -59,6 +63,7 @@ extract() {
cd ..; rm *.tar.* debian-binary
cd ..
;;
+ (*.zst) unzstd "$1" ;;
(*)
echo "extract: '$1' cannot be extracted" >&2
success=1