add github repo url

This commit is contained in:
Junv
2016-01-12 00:15:31 +08:00
parent 25ea8ae158
commit 310a36ced1
3 changed files with 13 additions and 2 deletions
+10
View File
@@ -9,3 +9,13 @@ GREP_PATH=$(unalias grep &> /dev/null; which grep) || display_error "$GREP_ERROR
SORT_PATH=$(unalias sort &> /dev/null; which sort) || display_error "$SORT_ERROR" || return 1
HEAD_PATH=$(unalias head &> /dev/null; which head) || display_error "$HEAD_ERROR" || return 1
GITHUB_REPO_URL=https://github.com/golang/go.git
GOOGLE_REPO_URL=https://go.googlesource.com/go
repo_url() {
if [[ "$GOOGLE" == "true" ]]; then
return GOOGLE_REPO_URL
else
return GITHUB_REPO_URL
fi
}
+1 -1
View File
@@ -21,7 +21,7 @@ read_command_line() {
show_usage
exit 1
fi
GO_SOURCE_URL=https://go.googlesource.com/go
GO_SOURCE_URL=https://github.com/golang/go.git
for i in "$@"; do
case $i in
-s=*|--source=*)
+2 -1
View File
@@ -32,7 +32,8 @@ read_command_line "$@"
echo
display_message "gvm gos (available)"
echo
versions=$(git ls-remote -t https://go.googlesource.com/go | awk -F/ '{ print $NF }' | $SORT_PATH)
go_repo_url=repo_url
versions=$(git ls-remote -t ${go_repo_url} | awk -F/ '{ print $NF }' | $SORT_PATH)
if [[ $? -ne 0 ]]; then
display_fatal "Failed to get version list from Google"
fi