Created
September 1, 2011 00:53
-
-
Save tysonmote/1185149 to your computer and use it in GitHub Desktop.
Find images that aren't referenced at all in a folder's code
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
`find /Users/tyson/project/images/`.split("\n").each do |path| | |
file = path.split("/").last | |
next if file.empty? || file == ".DS_Store" | |
result = `ack '#{file.gsub(".", "\\.")}' /Users/tyson/project` | |
puts path if result.empty? | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thought I could do this with a pithy one-liner shell script. Alas, it was beyond me.