Skip to content

Instantly share code, notes, and snippets.

@scoutman57
Created March 31, 2017 07:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scoutman57/63845c77df7bfdca6bd9ee0858775bc2 to your computer and use it in GitHub Desktop.
Save scoutman57/63845c77df7bfdca6bd9ee0858775bc2 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
puts "This program will add the OSX folder icon to your global .gitignore file."
puts "Enter the full path to your global .gitignore file."
print "Path: "
location = gets.chomp
if (location.nil?)
puts "No path specified, program exiting."
exit 1
end
f = File.open(location, "a+") # append
f.write("\n# REMINDER: do not edit between these lines")
f.write("\n# OSX folder icon Icon\\r Icon? Icon^M^M")
f.write("\nIcon\r\r")
f.write("\n# END REMINDER OSX folder icon\n")
f.close
exit # quit interactive ruby session
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment