diff --git a/.local/libexec/cron/trash-prune b/.local/libexec/cron/trash-prune index 29f9a9c3..924b9d9b 100755 --- a/.local/libexec/cron/trash-prune +++ b/.local/libexec/cron/trash-prune @@ -12,14 +12,17 @@ getfsroot() { list_trash_dirs() { for mnt in $(findmnt -Py -t "$types"); do - eval $mnt + eval "$mnt" + # shellcheck disable=2153 if [ "$TARGET" = "$(getfsroot "${XDG_DATA_HOME:-$HOME/.local/share}")" ]; then - echo "${XDG_DATA_HOME:-$HOME/.local/share}/Trash" + target=${XDG_DATA_HOME:-$HOME/.local/share}/Trash elif [ "$TARGET" = "/" ]; then - echo "/.Trash" + target=/.Trash else - echo "${TARGET}/.Trash" + target=${TARGET}/.Trash fi + [ -w "$target" ] && { echo "$target"; return; } + echo done }