Permalink
Browse files

Add git:ignore:xcode task: adds useful lines to your .gitignore for a…

…n Xcode project.

Signed-off-by: Dr Nic Williams <drnicwilliams@gmail.com>
  • Loading branch information...
1 parent 91ad4fb commit 4a833ceed9365e2367f1680d7a75054edf1f10b4 @Peeja Peeja committed with drnic Aug 30, 2008
Showing with 13 additions and 0 deletions.
  1. +13 −0 git/ignore/xcode.sake
View
@@ -0,0 +1,13 @@
+namespace 'git' do
+ namespace 'ignore' do
+ desc 'Ignore build and user-specific files in Xcode projects.'
+ task :xcode do
+ xcode_ignores = %w{ build *.xcodeproj/* !*.xcodeproj/project.pbxproj }.join("\n") + "\n"
+ File.open(".gitignore", "a+") do |gitignore|
+ gitignore.rewind
+ current_ignores = gitignore.read
+ (gitignore << xcode_ignores) unless current_ignores.include?(xcode_ignores)
+ end
+ end
+ end
+end

0 comments on commit 4a833ce

Please sign in to comment.