Skip to content

Instantly share code, notes, and snippets.

@marvhus
Created August 19, 2023 21:47
Show Gist options
  • Save marvhus/a7bbc86aa38e526cd1fe9241aed9971c to your computer and use it in GitHub Desktop.
Save marvhus/a7bbc86aa38e526cd1fe9241aed9971c to your computer and use it in GitHub Desktop.
Jai count lines of code
#!/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