Created
September 20, 2012 04:14
-
-
Save youcandanch/3753951 to your computer and use it in GitHub Desktop.
Dead simple repository reference count
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 | |
USAGE="usage: refcount.sh [string to check]" | |
if [[ $# = 0 ]] | |
then | |
echo $USAGE | |
exit 1 | |
fi | |
count=$(git grep -il $1 | wc -l) | |
list=$(git grep -in $1 | awk -F: '{print $2 "\t" $1}') | |
echo "Files containing references to $1 in the repo: $count" | |
echo | |
echo "$list" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment