From b9ede555c028614246f59aa2dea835948ef247fd Mon Sep 17 00:00:00 2001 From: godcong Date: Fri, 15 Nov 2024 18:50:58 +0800 Subject: [PATCH] build(upm): exclude example and test directories from upm processing - Modify the find command to exclude example and test directories - Improve readability and maintainability of the directory search logic --- scripts/upm.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/upm.sh b/scripts/upm.sh index 2d98819..97f761e 100644 --- a/scripts/upm.sh +++ b/scripts/upm.sh @@ -79,8 +79,15 @@ update_go_mod() { fi fi else - # Skip the root directory ('.') - find . -mindepth 1 -type d -not -path './.*' -print0 | while IFS= read -r -d '' dir; do + # Specify root directory + start_dir="." + find "$start_dir" -mindepth 1 -type d \ + -not -path "$start_dir/.*" \ + -not -path "$start_dir/example*" \ + -not -path "$start_dir/examples*" \ + -not -path "$start_dir/test*" \ + -not -path "$start_dir/tests*" \ + -print0 | while IFS= read -r -d '' dir; do if check_go_mod_and_act "$dir"; then echo "Processing directories in: $dir" local updated=$?