This file contains hidden or 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/sh | |
for FILE in $(git ls-files ./img); do | |
# echo files that should be removed | |
# git grep $(basename "$FILE") > /dev/null || echo "would remove $FILE" | |
# remove files that should be removed | |
git grep $(basename "$FILE") > /dev/null || git rm "$FILE" | |
done | |
# credit: https://tanzu.vmware.com/content/blog/a-simple-way-to-detect-unused-files-in-a-project-using-git |