Skip to content

Commit

Permalink
build(upm): exclude example and test directories from upm processing
Browse files Browse the repository at this point in the history
- Modify the find command to exclude example and test directories
- Improve readability and maintainability of the directory search logic
  • Loading branch information
godcong committed Nov 15, 2024
1 parent 6815599 commit b9ede55
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions scripts/upm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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=$?
Expand Down

0 comments on commit b9ede55

Please sign in to comment.