Skip to content

Instantly share code, notes, and snippets.

@izackp
Created March 12, 2014 17:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save izackp/9512478 to your computer and use it in GitHub Desktop.
Save izackp/9512478 to your computer and use it in GitHub Desktop.
#!/bin/bash
#Taken from: http://stackoverflow.com/questions/6113243/how-to-find-unused-images-in-an-xcode-project
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/FindUnusedImages.sh`; do git rm "$i"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment