Last active
December 30, 2015 02:59
-
-
Save travisjeffery/7766730 to your computer and use it in GitHub Desktop.
Remove xcode/objc header comments
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
#!/usr/bin/env ruby | |
files = Dir.glob("#{ARGV[0]}/**/*.{m,h}") | |
regexp = /^\/\/.*$\n/ | |
files.each do |filepath| | |
lines = [] | |
replace = true | |
IO.readlines(filepath).each do |line| | |
if !replace || !replace = line.match(regexp) | |
lines << line | |
end | |
end | |
lines.shift if lines[0] == "\n" | |
File.open(filepath, 'w') {|f| f.puts lines } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment