master
Alex 2023-05-10 00:05:39 -05:00
parent 8ef22f4a64
commit 4234c835e1
3 changed files with 4 additions and 3 deletions

View File

@ -57,7 +57,7 @@ compress() {
extract() { extract() {
set -f set -f
FILE="$(echo "$1" | xargs)" #use xargs to trim whitespace FILE="$(echo "$1" | xargs -0)" #use xargs to trim whitespace
DIR="$(basename "$FILE" | cut -f 1 -d '.')" DIR="$(basename "$FILE" | cut -f 1 -d '.')"
mkdir "$DIR" mkdir "$DIR"
case $FILE in case $FILE in
@ -65,7 +65,7 @@ extract() {
*.tar.gz|*.tgz) tar xzvf "$FILE" --directory="$DIR";; *.tar.gz|*.tgz) tar xzvf "$FILE" --directory="$DIR";;
*.tar.xz|*.txz) tar xJvf "$FILE" --directory="$DIR";; *.tar.xz|*.txz) tar xJvf "$FILE" --directory="$DIR";;
*.zip) unzip "$FILE" -d "$DIR";; *.zip) unzip "$FILE" -d "$DIR";;
*.rar) unrar x "$FILE" "$DIR";; *.rar) unrar-free -x "$FILE" "$DIR";;
*.7z | *.crx) 7z x "$FILE" -o"$DIR";; *.7z | *.crx) 7z x "$FILE" -o"$DIR";;
esac esac
} }

View File

@ -28,3 +28,5 @@ sudo dnf install rofi-wayland
sudo dnf copr enable derisis13/ani-cli sudo dnf copr enable derisis13/ani-cli
sudo dnf install ani-cli sudo dnf install ani-cli
sudo dnf install p7zip p7zip-plugins unrar-free

1
unrar
View File

@ -6,7 +6,6 @@
# $2 -> archive file name ex: archive.rar # $2 -> archive file name ex: archive.rar
# $3 -> (optional) directory to extract to # $3 -> (optional) directory to extract to
if [ "$1" = "x" ]; then if [ "$1" = "x" ]; then
if [ "$(echo "$2" | grep ".rar" )" ]; then if [ "$(echo "$2" | grep ".rar" )" ]; then
if [ -d "$3" ]; then if [ -d "$3" ]; then