Created
November 11, 2010 04:01
-
-
Save mcmoyer/671983 to your computer and use it in GitHub Desktop.
use inside web site to find references to files that aren't correctly cased.
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
#!/usr/bin/ruby | |
files = Dir['**/**'].sort | |
files.each do |file| | |
#do a case insensitve search first | |
all_matches = `ack -lic "#{file}"`.split("\n") | |
puts "found #{all_matches.length} matches for #{file}" | |
exact_matches = `ack -lc "#{file}"`.split("\n") | |
difference = all_matches - exact_matches | |
unless difference.empty? | |
puts "#{difference.join("\n")}\n\n-----------------------------------------" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment