Skip to content

Instantly share code, notes, and snippets.

@mullr
Created June 25, 2012 01:55
Show Gist options
  • Save mullr/2985977 to your computer and use it in GitHub Desktop.
Save mullr/2985977 to your computer and use it in GitHub Desktop.
Remove headers from xCode templates
#!/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