Last active
June 7, 2023 08:19
-
-
Save MCMi460/7832441af7e3ad2776d393757a3bb660 to your computer and use it in GitHub Desktop.
Counts number of lines in a Git repository. Use at root.
This file contains 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
#!/bin/bash | |
# Counts number of lines in a Git repository. Use at root. | |
#total=0 | |
#while IFS= read -r file; do | |
# lines=$(wc $file | xargs) | |
# total=$(($total+${lines%% *})) | |
#done <<< "$(git ls-files)" | |
#echo "There are $total lines in this repository!" | |
echo "There are $(git ls-files | xargs wc -l | tail -1 | xargs) lines in this repository!" # ...or | |
# I could not | |
# be a total moron | |
# and waste twenty | |
# minutes writing this |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I feel so dumb.