Skip to content

Instantly share code, notes, and snippets.

@simenbrekken
Created October 23, 2015 12:21
Show Gist options
  • Save simenbrekken/6bafa28b95b9d0d85329 to your computer and use it in GitHub Desktop.
Save simenbrekken/6bafa28b95b9d0d85329 to your computer and use it in GitHub Desktop.
Find unused modules
#/bin/bash
JS_FILES=$(find "$@" -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