1
0
mirror of https://github.com/robbyrussell/oh-my-zsh.git synced 2025-12-06 07:20:40 +01:00

extract: add zstd support (#8469)

This commit is contained in:
Filipe Nascimento
2019-12-17 13:35:40 -03:00
committed by Marc Cornellà
parent 664664f6cd
commit 1761685d3e
3 changed files with 9 additions and 1 deletions

View File

@@ -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