mirror of
https://github.com/paulirish/git-open.git
synced 2026-09-10 07:26:15 -04:00
Added support for AWS Code commit.
This commit is contained in:
parent
995e91591f
commit
557fd40b1c
17
git-open
17
git-open
|
|
@ -196,6 +196,23 @@ elif [[ "${#pathargs[@]}" -ge '2' && ${pathargs[${#pathargs[@]} - 2]} == '_git'
|
|||
# Keep project and repository name, append branch selector.
|
||||
providerBranchRef="?version=GB$branch"
|
||||
fi
|
||||
elif [[ "$domain" =~ amazonaws\.com$ ]]; then
|
||||
# AWS Code Commit
|
||||
# Take region name from domain.
|
||||
region=${domain#*.}
|
||||
region=${region%%.*}
|
||||
|
||||
# Replace domain.
|
||||
# Ex. git-codecommit.us-east-1.amazonaws.com -> us-east-1.console.aws.amazon.com
|
||||
domain="${region}.console.aws.amazon.com"
|
||||
|
||||
# Replace URL path.
|
||||
# Ex. v1/repos/example -> codecommit/home?region=us-east-1#/repository/example/browse/
|
||||
urlpath="codecommit/home?region=${region}#/repository/${urlpath##*/}/browse/"
|
||||
|
||||
# Replace branch ref.
|
||||
# Ex. /tree/foobar -> foobar/--/
|
||||
providerBranchRef="${providerBranchRef##*/}/--/"
|
||||
fi
|
||||
|
||||
openurl="$protocol://$domain/$urlpath"
|
||||
|
|
|
|||
Loading…
Reference in a new issue