Skip to content
Browse files

Merge branch 'hdennison/master'

Conflicts:
	push
  • Loading branch information...
2 parents 6567846 + 09fd601 commit f9cc89fe0a125564508699b6d86ddd0c55ed193a @jamiew committed
Showing with 10 additions and 2 deletions.
  1. +10 −2 push
View
12 push
@@ -44,10 +44,18 @@ fi
# Parse output into a sexy GitHub compare URL!
remote_url=$(git remote show $remote -n | grep Push | awk '{ print $3 }')
+
if [[ "$remote_url" =~ "github.com" ]]; then
- repo_url=$(echo $remote_url | sed 's/\(.*\)\.git/\1/')
- github_url="$repo_url/compare/$refs"
+ if [[ ${remote_url:0:4} == "git@" ]]; then
+ regEx='s/.*\:\(.*\)\.git/\1/'
+ url='https://github.com/'
+ else
+ regEx='s/\(.*\)\.git/\1/'
+ fi
+
+ repo_name=$(echo $remote_url | sed $regEx)
+ github_url="$url$repo_name/compare/$refs"
copied="Compare URL copied to clipboard!"
which pbcopy >& /dev/null && echo $github_url | pbcopy && echo $copied

0 comments on commit f9cc89f

Please sign in to comment.
Something went wrong with that request. Please try again.