Created
December 19, 2013 04:39
-
-
Save DerekK19/8034495 to your computer and use it in GitHub Desktop.
Find unused images in an Xcode project. Install ack first (using brew install ack)
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 | |
for i in `find . -name "*.png" -o -name "*.jpg"`; do | |
file=`basename -s .jpg "$i" | xargs basename -s .png | xargs basename -s @2x` | |
result=`ack -i "$file"` | |
if [ -z "$result" ]; then | |
echo "$i" | |
fi | |
done | |
# Ex: to remove from git | |
# for i in `./script/unused_images.sh`; do git rm "$i"; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment