Added xz and zst do extract command

main
Thomas Ba. 4 years ago committed by GitHub
parent 8ca988ab33
commit 99f611b3fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -32,19 +32,21 @@ whothefuckisusingport() {
# functions # functions
function extract () { function extract () {
if [ -f $1 ] ; then if [ -f "$1" ] ; then
case $1 in case "$1" in
*.tar.bz2) tar xvjf $1 ;; *.tar.bz2) tar xvjf "$1" ;;
*.tar.gz) tar xvzf $1 ;; *.tar.gz) tar xvzf "$1" ;;
*.bz2) bunzip2 $1 ;; *.bz2) bunzip2 "$1" ;;
*.rar) unrar x $1 ;; *.rar) unrar x "$1" ;;
*.gz) gunzip $1 ;; *.gz) gunzip "$1" ;;
*.tar) tar xvf $1 ;; *.tar) tar xvf "$1" ;;
*.tbz2) tar xvjf $1 ;; *.tbz2) tar xvjf "$1" ;;
*.tgz) tar xvzf $1 ;; *.tgz) tar xvzf "$1" ;;
*.zip) unzip $1 ;; *.zip) unzip "$1" ;;
*.Z) uncompress $1 ;; *.Z) uncompress "$1" ;;
*.7z) 7z x $1 ;; *.7z) 7z x "$1" ;;
*.xz) unxz "$1" ;;
*.zst) zstd -d "$1" ;;
*) echo "don't know how to extract '$1'..." ;; *) echo "don't know how to extract '$1'..." ;;
esac esac
else else

Loading…
Cancel
Save