mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-22 04:11:58 +00:00
feat(extract): add pbzip2
and pixz
(#11435)
This commit is contained in:
parent
df658350a3
commit
4b5076b5ec
1 changed files with 6 additions and 3 deletions
|
@ -30,12 +30,15 @@ EOF
|
||||||
local extract_dir="${1:t:r}"
|
local extract_dir="${1:t:r}"
|
||||||
local file="$1" full_path="${1:A}"
|
local file="$1" full_path="${1:A}"
|
||||||
case "${file:l}" in
|
case "${file:l}" in
|
||||||
(*.tar.gz|*.tgz) (( $+commands[pigz] )) && { pigz -dc "$file" | tar xv } || tar zxvf "$file" ;;
|
(*.tar.gz|*.tgz)
|
||||||
(*.tar.bz2|*.tbz|*.tbz2) tar xvjf "$file" ;;
|
(( $+commands[pigz] )) && { tar -I pigz -xvf "$file" } || tar zxvf "$file" ;;
|
||||||
|
(*.tar.bz2|*.tbz|*.tbz2)
|
||||||
|
(( $+commands[pbzip2] )) && { tar -I pbzip2 -xvf "$file" } || tar xvjf "$file" ;;
|
||||||
(*.tar.xz|*.txz)
|
(*.tar.xz|*.txz)
|
||||||
|
(( $+commands[pixz] )) && { tar -I pixz -xvf "$file" } || {
|
||||||
tar --xz --help &> /dev/null \
|
tar --xz --help &> /dev/null \
|
||||||
&& tar --xz -xvf "$file" \
|
&& tar --xz -xvf "$file" \
|
||||||
|| xzcat "$file" | tar xvf - ;;
|
|| xzcat "$file" | tar xvf - } ;;
|
||||||
(*.tar.zma|*.tlz)
|
(*.tar.zma|*.tlz)
|
||||||
tar --lzma --help &> /dev/null \
|
tar --lzma --help &> /dev/null \
|
||||||
&& tar --lzma -xvf "$file" \
|
&& tar --lzma -xvf "$file" \
|
||||||
|
|
Loading…
Reference in a new issue