Created
August 19, 2023 21:47
-
-
Save marvhus/a7bbc86aa38e526cd1fe9241aed9971c to your computer and use it in GitHub Desktop.
Jai count lines of code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Small script to count lines in .jai files | |
# Cloc doesn't support jai, so I just made this for now | |
files=$(find $1 -name "*.jai") | |
if [ "$1" == "" ]; then | |
echo "No path" | |
exit 1 | |
fi | |
total=0 | |
count=0 | |
echo "----------" | |
for file in $files; do | |
[ -f "$file" ] || continue | |
lines=$(cat $file | wc -l) | |
echo "File: $lines - $file" | |
count=$(($count + 1)) | |
total=$(($total + $lines)) | |
done | |
echo "----------" | |
echo "Files: $count" | |
echo "Lines: $total" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment