Skip to content

Instantly share code, notes, and snippets.

@walchko
Created September 15, 2017 02:43
Show Gist options
  • Save walchko/69671eaf3e6a0b95b4f25aabf8a4d38e to your computer and use it in GitHub Desktop.
Save walchko/69671eaf3e6a0b95b4f25aabf8a4d38e to your computer and use it in GitHub Desktop.
Count lines of code in a git repo
#!/usr/bin/env bash
set -e
TMP=/var/tmp/temp-linecount-repo
git clone --depth 1 "$1" ${TMP}
printf "('${TMP}' will be deleted automatically)\n\n\n"
cloc ${TMP}
rm -rf ${TMP}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment