Created
October 13, 2023 06:31
-
-
Save birchb1024/0c7af5bc8f6618f89b0eaeb1779ee589 to your computer and use it in GitHub Desktop.
Use cloc to report SLOC for the api repos in the current directory
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
#!/Users/bill.birch/workspace/gocode/bin/elvish | |
# | |
# Get lines of code for the repos in the current directory | |
# | |
find api* -maxdepth 0 -type d | ^ | |
each {|D| | |
cloc --exclude-dir=generated -json --timeout 0 $D ^ | |
| from-json ^ | |
| put [$D (one)[SUM][code]] | |
} | order &reverse=$true &key={|L| put $L[1]} ^ | |
| each {|L| printf "%s %d\n" $L[0] $L[1]} ^ | |
| column -t | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment