From 6101e0a5edbfa798cd4e4a92e112ca9d7718c267 Mon Sep 17 00:00:00 2001 From: Ralph Whitbeck Date: Sat, 24 Jan 2015 21:35:37 -0500 Subject: [PATCH] Added support for bitbucket, ref gh-2 --- git-open | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/git-open b/git-open index cbc1216..126edcc 100755 --- a/git-open +++ b/git-open @@ -36,7 +36,13 @@ fi # URL normalization -giturl=${giturl/git\@github\.com\:/https://github.com/} +# Github support +if grep -q github <<<$giturl; then + giturl=${giturl/git\@github\.com\:/https://github.com/} +# bitbucket support +elif grep -q bitbucket <<<$giturl; then + giturl=${giturl/git\@bitbucket\.org\:/https://bitbucket.org/} +fi giturl=${giturl%\.git} @@ -56,7 +62,7 @@ fi # simplify URL for master giturl=${giturl/tree\/master/} -# get corrent open browser command +# get current open browser command if [ $(uname -s) == "Darwin" ] then open=open