summaryrefslogtreecommitdiff
path: root/plugins/extract/extract.plugin.zsh
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/extract/extract.plugin.zsh')
-rw-r--r--plugins/extract/extract.plugin.zsh14
1 files changed, 7 insertions, 7 deletions
diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh
index 7352e5bad..690126ba6 100644
--- a/plugins/extract/extract.plugin.zsh
+++ b/plugins/extract/extract.plugin.zsh
@@ -23,7 +23,7 @@ function extract() {
remove_archive=1
if [[ "$1" == "-r" ]] || [[ "$1" == "--remove" ]]; then
- remove_archive=0
+ remove_archive=0
shift
fi
@@ -38,7 +38,7 @@ function extract() {
file_name="$( basename "$1" )"
extract_dir="$( echo "$file_name" | sed "s/\.${1##*.}//g" )"
case "$1" in
- (*.tar.gz|*.tgz) tar xvzf "$1" ;;
+ (*.tar.gz|*.tgz) [ -z $commands[pigz] ] && tar zxvf "$1" || pigz -dc "$1" | tar xv ;;
(*.tar.bz2|*.tbz|*.tbz2) tar xvjf "$1" ;;
(*.tar.xz|*.txz) tar --xz --help &> /dev/null \
&& tar --xz -xvf "$1" \
@@ -47,12 +47,12 @@ function extract() {
&& tar --lzma -xvf "$1" \
|| lzcat "$1" | tar xvf - ;;
(*.tar) tar xvf "$1" ;;
- (*.gz) gunzip "$1" ;;
+ (*.gz) [ -z $commands[pigz] ] && gunzip "$1" || pigz -d "$1" ;;
(*.bz2) bunzip2 "$1" ;;
(*.xz) unxz "$1" ;;
(*.lzma) unlzma "$1" ;;
(*.Z) uncompress "$1" ;;
- (*.zip|*.war|*.jar) unzip "$1" -d $extract_dir ;;
+ (*.zip|*.war|*.jar|*.sublime-package|*.ipsw) unzip "$1" -d $extract_dir ;;
(*.rar) unrar x -ad "$1" ;;
(*.7z) 7za x "$1" ;;
(*.deb)
@@ -64,10 +64,10 @@ function extract() {
cd ..; rm *.tar.gz debian-binary
cd ..
;;
- (*)
+ (*)
echo "extract: '$1' cannot be extracted" 1>&2
- success=1
- ;;
+ success=1
+ ;;
esac
(( success = $success > 0 ? $success : $? ))