Guest User

Untitled

a guest
Aug 17th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #!/usr/bin/env ruby
  2.  
  3. require 'rubygems'
  4. require 'escape'
  5.  
  6. dammit = Dir['**/.DS_Store']
  7. if dammit.empty?
  8. puts 'Clean'
  9. exit
  10. end
  11.  
  12. system "git rm #{dammit.map(&Escape.method(:shell_single_word)).join ' '}"
  13. exec 'git', 'commit', '-m', <<-EOF, *dammit
  14. Easy way to prevent .DS_Store from appearing in the future:
  15.  
  16. ~/.gitconfig:
  17. [core]
  18. excludesfile = /home/USER/.gitgnore
  19.  
  20. ~/.gitignore:
  21. _darcs
  22. .*.sw[poq]
  23. .svn
  24. .sw[poq]
  25. tags
  26. .DS_Store
  27. Thumbs.db
  28. EOF
Add Comment
Please, Sign In to add comment