From 99f611b3fc796a521d4e7ebd9bef23cfc337d955 Mon Sep 17 00:00:00 2001 From: Thomas Ba Date: Thu, 11 Feb 2021 09:57:18 +0100 Subject: [PATCH] Added xz and zst do extract command --- zsh/commands | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/zsh/commands b/zsh/commands index d8c39b7..79c563f 100644 --- a/zsh/commands +++ b/zsh/commands @@ -32,19 +32,21 @@ whothefuckisusingport() { # functions function extract () { - if [ -f $1 ] ; then - case $1 in - *.tar.bz2) tar xvjf $1 ;; - *.tar.gz) tar xvzf $1 ;; - *.bz2) bunzip2 $1 ;; - *.rar) unrar x $1 ;; - *.gz) gunzip $1 ;; - *.tar) tar xvf $1 ;; - *.tbz2) tar xvjf $1 ;; - *.tgz) tar xvzf $1 ;; - *.zip) unzip $1 ;; - *.Z) uncompress $1 ;; - *.7z) 7z x $1 ;; + if [ -f "$1" ] ; then + case "$1" in + *.tar.bz2) tar xvjf "$1" ;; + *.tar.gz) tar xvzf "$1" ;; + *.bz2) bunzip2 "$1" ;; + *.rar) unrar x "$1" ;; + *.gz) gunzip "$1" ;; + *.tar) tar xvf "$1" ;; + *.tbz2) tar xvjf "$1" ;; + *.tgz) tar xvzf "$1" ;; + *.zip) unzip "$1" ;; + *.Z) uncompress "$1" ;; + *.7z) 7z x "$1" ;; + *.xz) unxz "$1" ;; + *.zst) zstd -d "$1" ;; *) echo "don't know how to extract '$1'..." ;; esac else