Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env ruby
- require 'rubygems'
- require 'escape'
- dammit = Dir['**/.DS_Store']
- if dammit.empty?
- puts 'Clean'
- exit
- end
- system "git rm #{dammit.map(&Escape.method(:shell_single_word)).join ' '}"
- exec 'git', 'commit', '-m', <<-EOF, *dammit
- Easy way to prevent .DS_Store from appearing in the future:
- ~/.gitconfig:
- [core]
- excludesfile = /home/USER/.gitgnore
- ~/.gitignore:
- _darcs
- .*.sw[poq]
- .svn
- .sw[poq]
- tags
- .DS_Store
- Thumbs.db
- EOF
Add Comment
Please, Sign In to add comment