Skip to content

Instantly share code, notes, and snippets.

@tysonmote
Created September 1, 2011 00:53
Show Gist options
  • Save tysonmote/1185149 to your computer and use it in GitHub Desktop.
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
`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
@tysonmote
Copy link
Author

Thought I could do this with a pithy one-liner shell script. Alas, it was beyond me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment