From b42c90572b177d4ce614a08992623a9c91cb5f7c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 7 Jan 2026 22:28:18 +0000 Subject: [PATCH] Address code review feedback: improve find commands Co-authored-by: kuhyx <147418882+kuhyx@users.noreply.github.com> --- scripts/utils/download_exercism_bulk.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/scripts/utils/download_exercism_bulk.sh b/scripts/utils/download_exercism_bulk.sh index 869ba83..f1d3b09 100755 --- a/scripts/utils/download_exercism_bulk.sh +++ b/scripts/utils/download_exercism_bulk.sh @@ -64,9 +64,7 @@ for track in "${!TRACKS[@]}"; do # Show exercise count if [[ -d "$track/exercises/practice" ]]; then - count=$(find "$track/exercises/practice" -maxdepth 1 -type d | wc -l) - # Subtract 1 for the parent directory itself - count=$((count - 1)) + count=$(find "$track/exercises/practice" -mindepth 1 -maxdepth 1 -type d | wc -l) echo " → $count practice exercises available" fi echo "" @@ -102,9 +100,7 @@ echo "" echo "Track summary:" for track in "${!TRACKS[@]}"; do if [[ -d "$track/exercises/practice" ]]; then - count=$(find "$track/exercises/practice" -maxdepth 1 -type d 2> /dev/null | wc -l) - # Subtract 1 for the parent directory itself - count=$((count - 1)) + count=$(find "$track/exercises/practice" -mindepth 1 -maxdepth 1 -type d 2> /dev/null | wc -l) printf " %-15s %3d exercises\n" "$track" "$count" fi done | sort