Don't try and delete ./target/. (#42680)

Conrad Irwin created

Release Notes:

- N/A

Change summary

script/clear-target-dir-if-larger-than | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

Detailed changes

script/clear-target-dir-if-larger-than 🔗

@@ -21,5 +21,6 @@ echo "target directory size: ${current_size_gb}gb. max size: ${max_size_gb}gb"
 
 if [[ ${current_size_gb} -gt ${max_size_gb} ]]; then
     echo "clearing target directory"
-    rm -rf target/* target/.*
+    shopt -s dotglob
+    rm -rf target/*
 fi