Created
December 10, 2014 14:53
-
-
Save gogiel/b8c8f1d55e6c783d0113 to your computer and use it in GitHub Desktop.
This file contains 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
# Requires `brew install ag` | |
dirname = ARGV[0] | |
records = Dir.glob(File.join(dirname, "**/*")) | |
possible_extensions = %w(jpeg jpg svg gif png css scss js coffee htc ejs jst).map{|ext| ".#{ext}"} | |
names = records. | |
reject{|path| File.directory?(path) }. | |
reject{|path| path =~ /@2x/}. | |
map do |path| | |
name = File.basename path | |
while true | |
ext = File.extname(name) | |
if possible_extensions.include? ext | |
name = File.basename name, ext | |
else | |
break | |
end | |
end | |
[name, path] | |
end | |
names.each do |data| | |
name, path = data | |
`ag '#{name}' --ignore '*.svg' > /dev/null` | |
if $? != 0 | |
puts path | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment