Skip to content

Commit

Permalink
Merge pull request #2853 from tarlepp/chore(tools)/project-stats-update
Browse files Browse the repository at this point in the history
Chore(tools) - Updated `project-stats.sh` script to cover all project related files
  • Loading branch information
tarlepp authored Sep 28, 2024
2 parents 7aa9ff9 + af96c69 commit 964d89b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/project-stats.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ printf "%-15s %10s %14s\n" "Extension" "File count" "Line count"

echo -e "-----------------------------------------"

find ./src -type f -iname '*.*' | sed -n 's/.*\.//p' | tr '[:upper:]' '[:lower:]' | sort | uniq -c | while read count extension; do
line_count=$(find ./src -name "*.$extension" -type f -print0 | xargs -0 cat | wc -l)
find ./migrations ./public ./src ./tests -type f -iname '*.*' | sed -n 's/.*\.//p' | tr '[:upper:]' '[:lower:]' | sort | uniq -c | while read count extension; do
line_count=$(find ./src ./tests -name "*.$extension" -type f -print0 | xargs -0 cat | wc -l)
printf "%-15s %10d %14d\n" ".$extension" "$count" "$line_count"
done

echo -e "-----------------------------------------"

total_files=$(find ./src -type f | wc -l)
total_lines=$(find ./src -type f -exec cat {} + | wc -l)
total_files=$(find ./migrations ./public ./src ./tests -type f | wc -l)
total_lines=$(find ./migrations ./public ./src ./tests -type f -exec cat {} + | wc -l)

printf "%-15s %10d %14d\n" "Total:" "$total_files" "$total_lines"

0 comments on commit 964d89b

Please sign in to comment.