Skip to content

Instantly share code, notes, and snippets.

@rubyist
Created May 23, 2014 22:42
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 rubyist/ebe823505be0f25b964e to your computer and use it in GitHub Desktop.
Save rubyist/ebe823505be0f25b964e to your computer and use it in GitHub Desktop.
gh open
#!/usr/bin/env ruby
require 'rubygems'
require 'parseconfig'
config = ParseConfig.new('.git/config')
url = config["remote \"origin\""]["url"]
if url =~ /^git@/
url = "https://#{url.sub!(/git@/, '').sub!(':', '/').sub!('.git', '')}"
else
url = url.sub('.git', '')
end
`open #{url}`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment