From 68260a48bb63c62289999b6611e1353ba4fcfe1d Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 23 Jan 2024 17:17:47 -0800 Subject: [PATCH] Don't error when checking target dir size if there is no target dir --- script/clear-target-dir-if-larger-than | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/script/clear-target-dir-if-larger-than b/script/clear-target-dir-if-larger-than index 59c07f77f7..d23c111ec1 100755 --- a/script/clear-target-dir-if-larger-than +++ b/script/clear-target-dir-if-larger-than @@ -7,6 +7,11 @@ if [[ $# < 1 ]]; then exit 1 fi +if ! [[ -d target ]]; then + echo "target directory does not exist yet" + exit 0 +fi + max_size_gb=$1 current_size=$(du -s target | cut -f1)