Skip to content

Instantly share code, notes, and snippets.

@careo
Created January 29, 2010 22:45
Show Gist options
  • Save careo/290230 to your computer and use it in GitHub Desktop.
Save careo/290230 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
forbidden = ["~","~/Desktop"].collect { |path| File.expand_path path }
target = File.expand_path ARGV[0]
if forbidden.include? target
puts "You don't REALLY want to open #{target} in TextMate, do you?"
exit 1
else
exec "/usr/bin/mate", *ARGV
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment