From c737f42af9df7ca38dd81b10c37a98d5d6715ad4 Mon Sep 17 00:00:00 2001 From: RealStickman Date: Tue, 17 Nov 2020 21:18:37 +0100 Subject: [PATCH] Make this script slightly safer --- arch-config/scripts/clean-trash.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/arch-config/scripts/clean-trash.sh b/arch-config/scripts/clean-trash.sh index b8c3575e..ac1ea804 100644 --- a/arch-config/scripts/clean-trash.sh +++ b/arch-config/scripts/clean-trash.sh @@ -2,5 +2,13 @@ set -euo pipefail -rm -rvf $HOME/.local/share/Trash -rm -rvf /mnt/1d90c4d5-21d2-4455-bb4a-814de8496744/.Trash-1000/ +if [ -d "$HOME/.local/share/Trash" ]; then + rm -rvf "$HOME/.local/share/Trash" +fi + +if [ -d "/mnt/1d90c4d5-21d2-4455-bb4a-814de8496744/.Trash-1000/" ]; then + rm -rvf /mnt/1d90c4d5-21d2-4455-bb4a-814de8496744/.Trash-1000/ +fi + + +exit 0