make trash-prune less noisy on missing perms
This commit is contained in:
parent
7ee761c59d
commit
bfdcb2e2ea
1 changed files with 7 additions and 4 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue