Always assume origin is a GitHub instance (adds support for self-hosted GitHub Enterprise URLs)
Fixes https://github.com/tonchis/vim-to-github/issues/18!
This PR assumes that the origin repo is always a GitHub instance, which adds compatibility for company-hosted GitHub Enterprise instances with a different site name. This replaces the hard-coded github.com in the regex and https://github.com in the URL output with an additional sed command to capture the site name and reuse it in the URL.
For example, with an upstream origin URL of...
[email protected]:example-org/example-repo.git
...this PR would produce this URL for a few lines on README.md:
https://github.mycompany.com/example-org/example-repo/blob/caf758b2dbe03480dd340dd339379ca86797e6b6/README.md#L11-L27
Prior to this PR, a URL like this is produced:
https://github.com///blob/caf758b2dbe03480dd340dd339379ca86797e6b6/README.md#L11-L27