Skip to content

Instantly share code, notes, and snippets.

@justinabrahms
justinabrahms / gist:5673408
Created May 29, 2013 20:05
Short script which will grep your project for unused requirejs imports. Usage: `/path/to/file.sh application/js/directory`
#/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"