Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Ohmyzsh
Commits
a5c38325
Commit
a5c38325
authored
Apr 17, 2011
by
Sorin Ionescu
Browse files
Handle tar.xz and tar.lzma better (credit: @gwjo).
parent
1db6575f
Changes
1
Hide whitespace changes
Inline
Side-by-side
plugins/extract/extract.plugin.zsh
View file @
a5c38325
...
...
@@ -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
"
;;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment