Skip to content

Instantly share code, notes, and snippets.

@DerekK19
Created December 19, 2013 04:39
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 DerekK19/8034495 to your computer and use it in GitHub Desktop.
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)
#!/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