Skip to content

Instantly share code, notes, and snippets.

@odewahn
Last active November 10, 2020 13:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save odewahn/ad46cd71e2f90ded4578147eeb3d51b1 to your computer and use it in GitHub Desktop.
Save odewahn/ad46cd71e2f90ded4578147eeb3d51b1 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
#
# See https://stackoverflow.com/questions/26881441/can-you-get-the-number-of-lines-of-code-from-a-github-repository
#
git clone --depth 1 git@github.com:oreillymedia/heron.git
printf "\nTotal lines\n"
echo "========================="
cloc heron --quiet --csv --include-lang=Python,JavaScript,HTML --exclude-dir=migrations | cut -d ',' -f 2,5
printf "\nLines excluding tests\n"
echo "========================="
cloc heron --quiet --csv --include-lang=Python,JavaScript,HTML --exclude-dir=migrations,tests | cut -d ',' -f 2,5
rm -rf heron
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment