Last active
May 11, 2018 20:26
-
-
Save deybhayden/0a9715a383252f052589dd4df0667a75 to your computer and use it in GitHub Desktop.
Function to count lines of code in a passed file type
This file contains hidden or 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
# Function to count lines of code in a passed file type | |
# use git ls-files to ignore any of the same file type passed in that we don't care about | |
count() { | |
git ls-files "*.$1" "**/*.$1" | xargs grep -H -c '[^[:space:]]' | sort -nr -t":" -k2 | less | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment