Created
May 29, 2013 20:05
-
-
Save justinabrahms/5673408 to your computer and use it in GitHub Desktop.
Short script which will grep your project for unused requirejs imports. Usage: `/path/to/file.sh application/js/directory`
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 | |
JS_FILES=$(find "$1" -name "*.js") | |
for FILE in $JS_FILES; do | |
short_name=`basename $FILE` | |
filename="${short_name%.*}" | |
git grep --quiet $filename 1>/dev/null | |
if [ "$?" == "1" ]; then | |
echo "Should delete: $FILE" | |
fi | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment