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