mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-11 00:10:08 +00:00
Handle tar.xz and tar.lzma better (credit: @gwjo).
This commit is contained in:
parent
1db6575f14
commit
a5c383258b
1 changed files with 7 additions and 5 deletions
|
@ -2,7 +2,7 @@
|
|||
# FILE: extract.plugin.zsh
|
||||
# DESCRIPTION: oh-my-zsh plugin file.
|
||||
# AUTHOR: Sorin Ionescu (sorin.ionescu@gmail.com)
|
||||
# VERSION: 1.0.0
|
||||
# VERSION: 1.0.1
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
@ -40,10 +40,12 @@ function extract() {
|
|||
case "$1" in
|
||||
(*.tar.gz|*.tgz) tar xvzf "$1" ;;
|
||||
(*.tar.bz2|*.tbz|*.tbz2) tar xvjf "$1" ;;
|
||||
(*.tar.xz|*.txz) tar xvJf "$1" ;;
|
||||
# (*.tar.xz|*.txz) xzcat "$1" | tar xvf - ;;
|
||||
(*.tar.lzma|*.tlz) tar --lzma -xvf "$1" ;;
|
||||
# (*.tar.lzma|*.tlz) lzcat "$1" | tar xvf - ;;
|
||||
(*.tar.xz|*.txz) tar --xz --help &> /dev/null \
|
||||
&& tar --xz -xvf "$1" \
|
||||
|| xzcat "$1" | tar xvf - ;;
|
||||
(*.tar.zma|*.tlz) tar --lzma --help &> /dev/null \
|
||||
&& tar --lzma -xvf "$1" \
|
||||
|| lzcat "$1" | tar xvf - ;;
|
||||
(*.tar) tar xvf "$1" ;;
|
||||
(*.gz) gunzip "$1" ;;
|
||||
(*.bz2) bunzip2 "$1" ;;
|
||||
|
|
Loading…
Reference in a new issue