Created
June 25, 2012 01:55
-
-
Save mullr/2985977 to your computer and use it in GitHub Desktop.
Remove headers from xCode templates
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 | |
require 'fileutils' | |
include FileUtils | |
files = `find /Applications/Xcode.app -path *.xctemplate/*.h -o -path *.xctemplate/*.m`.split("\n") | |
backupDir = File.expand_path "~/.xcTemplateBackup" | |
mkdir backupDir unless File.exists? backupDir | |
files.each do |f| | |
dest_file = "#{backupDir}#{f}" | |
mkdir_p( File.dirname(dest_file) ) | |
cp f, dest_file | |
end | |
files.each do |f| | |
puts "fixing #{f}" | |
`sudo sed -i '' '1,/^$/d' \"#{f}\"` | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment