Skip to content

Instantly share code, notes, and snippets.

@betzerra
Created June 11, 2012 15:15
Show Gist options
  • Save betzerra/2910592 to your computer and use it in GitHub Desktop.
Save betzerra/2910592 to your computer and use it in GitHub Desktop.
Finds unused resources (images actually) from an XCode project
#!/bin/bash
# Found at http://gr3p.com/2012/06/encontrar-recursos-no-usados-en-un-proyecto-de-xcode
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment