From 0878e51e6a017f234153c4759dbaa3da2bf36334 Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Sat, 15 Oct 2022 02:08:53 +0200 Subject: [PATCH] bin: adjust moul and clean --- .local/bin/scripts/clean | 6 ++++-- .local/bin/scripts/moul | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.local/bin/scripts/clean b/.local/bin/scripts/clean index 04456f7..f8d8e4d 100755 --- a/.local/bin/scripts/clean +++ b/.local/bin/scripts/clean @@ -21,8 +21,10 @@ find "$dir" -maxdepth 2 -not -name ".stfolder" -empty -printf "Removing empty %p find -L -maxdepth 2 -type l -printf "Removing broken symlink %p\n" -delete 2>/dev/null highlight "y :: recursively remove empty folders and files" -[[ $1 =~ "y" ]] && - find \( -name ".stfolder" -o -name ".*keep" -o -name ".git" \) -prune -o -empty -printf "Removing empty %p\n" -exec rm -d {} + +if [[ $1 =~ "y" ]]; then + find -name '.thumbnails' -printf "Pre-cleaning %p\n" -exec rm -r {} + + find \( -name ".stfolder" -o -name ".*keep" -o -name ".git" -o -name "tmp" -o -name ".nomedia" \) -prune -o -empty -printf "Removing empty %p\n" -exec rm -d {} + +fi highlight "e :: remove downloaded emacs packages (rebuild takes minutes!)" [[ $1 =~ "e" ]] && diff --git a/.local/bin/scripts/moul b/.local/bin/scripts/moul index d93d4a5..0b70e4a 100755 --- a/.local/bin/scripts/moul +++ b/.local/bin/scripts/moul @@ -20,7 +20,7 @@ esac # FSTAB: BY LABEL if grep --word-regexp "LABEL=$arg" /etc/fstab then # have to mount twice as the first one might be creating the directory - mount -L "$@" 2>/dev/null || mount -L "$@" + mount -L "$arg" "$@" 2>/dev/null || mount -L "$arg" "$@" exit $? fi # FSTAB: BY MOUNTPOINT/NAME