Skip to content

Instantly share code, notes, and snippets.

@mybuddymichael
Forked from andrewvc/count-clj-sloc.sh
Last active December 10, 2015 01:48
Show Gist options
  • Save mybuddymichael/4361405 to your computer and use it in GitHub Desktop.
Save mybuddymichael/4361405 to your computer and use it in GitHub Desktop.
Count the lines of code in a Clojure project (`src` and `test` directories only).
# Count SLOC
export SLF=`mktemp -t cljsloc`; \
find src test -name "*.clj" \
| xargs egrep -v "(^[[:space:]]*$|^[[:space:]]*;)" \
| cut -d: -f1 > $SLF && echo "Files"; \
uniq -c $SLF; \
echo "Total" `cat $SLF | wc -l`; \
rm $SLF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment