diff --git a/scripts/function/tools b/scripts/function/tools index 8210129..54ea775 100644 --- a/scripts/function/tools +++ b/scripts/function/tools @@ -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 +} \ No newline at end of file diff --git a/scripts/install b/scripts/install index 36b226c..07d31b9 100755 --- a/scripts/install +++ b/scripts/install @@ -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=*) diff --git a/scripts/listall b/scripts/listall index 6e7c634..70371ee 100755 --- a/scripts/listall +++ b/scripts/listall @@ -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