commit 4dd8e8e02dac1c139f85edafe0a46c9f4f3c5375
parent 92aca81f5528fe453c8da9dda92c5bf27f706572
Author: Solene Rapenne <solene@perso.pw>
Date: Mon, 13 Aug 2018 13:42:38 +0200
prevent calling rm if absent folder exists but is empty
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drist b/drist
@@ -54,7 +54,7 @@ delete_files() {
printf 'Removing files:\n'
find "$1" -type f | sed 's/"/\\&/' | \
awk -v path="${1}" '{ printf "\"%s\" ",substr($0,length(path)+1)}' > "${LIST}"
- ssh "$2" "rm -v $(cat $LIST)"
+ test -s "$LIST" && ssh "$2" "rm -v $(cat $LIST)"
fi
fi
}