From fd36592ffea2d9e4d53eefcb882a4d5ac0c71652 Mon Sep 17 00:00:00 2001 From: Brendan Maguire Date: Wed, 18 May 2016 14:43:38 +0100 Subject: [PATCH] Support for Github enterprise servers * Only works if the server has 'github' in the domain name --- git-open | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/git-open b/git-open index f847a6d..e4930ca 100755 --- a/git-open +++ b/git-open @@ -48,12 +48,12 @@ if grep -q gist.github <<<$giturl; then giturl=${giturl/git\@gist.github\.com\:/https://gist.github.com} providerUrlDifference=tree -# Github +# Github (or enterprise Github if 'github' in url) elif grep -q github <<<$giturl; then - giturl=${giturl/git\@github\.com\:/https://github.com/} - # handle SSH protocol (links like ssh://git@github.com/user/repo) - giturl=${giturl/#ssh\:\/\/git\@github\.com\//https://github.com/} + giturl=${giturl/#ssh\:\/\//} + + giturl=`echo $giturl | sed 's/git\@\(github[^:]*\):/https:\/\/\1\//'` providerUrlDifference=tree