Merge pull request #27 from davidosomething/with-rev

Open to source in current dir
This commit is contained in:
Paul Irish 2015-05-20 03:28:56 -07:00
commit 9dced58c8c

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Opens the github page for a repo/branch in your browser.
# https://github.com/paulirish/git-open/
@ -56,7 +56,9 @@ elif grep -q github <<<$giturl; then
# bitbucket
elif grep -q bitbucket <<<$giturl; then
giturl=${giturl/git\@bitbucket\.org\:/https://bitbucket.org/}
providerUrlDifference="src"
rev="$(git rev-parse HEAD)"
git_pwd="$(git rev-parse --show-prefix)"
providerUrlDifference="src/${rev}/${git_pwd}"
branch="?at=${branch}"
# Atlassian Stash
@ -97,7 +99,7 @@ case $( uname -s ) in
Darwin) open=open;;
MINGW*) open=start;;
CYGWIN*) open=cygstart;;
*) open=xdg-open;;
*) open=${BROWSER:-xdg-open};;
esac
# open it in a browser