Skip to content

Commit

Permalink
Merge pull request #24 from sgerrand/update-download-location
Browse files Browse the repository at this point in the history
Update download URI
  • Loading branch information
spraints committed Jun 22, 2016
2 parents 3e607d8 + ec42859 commit 0e958b6
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions libexec/goenv-install
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,19 @@ else
fi

if [ "$platform" = "darwin" ]; then
# Since go version 1.2, osx packages were subdivided into 10.6 and 10.8
if [ "$version" = "1.2" -o "$version" \> "1.2" ]; then
# Since go version 1.2, macOS packages were subdivided into 10.6 and 10.8
# After version 1.4.2, the OS version postfix was dropped
if [ "$version" \> "1.4.2" ]; then
extra=""
elif [ "$version" = "1.2" -o "$version" \> "1.2" -o "$version" \< "1.4.3" ]; then
if [ "$(uname -r)" \> "12" ]; then
extra="-osx10.8"
extra="-osx10.6"
else
extra="-osx10.6"
fi
fi
fi




function vercomp () {
# http://stackoverflow.com/questions/4023830
# 0: '='
Expand Down Expand Up @@ -81,15 +81,8 @@ function vercomp () {
# echo 0
}

download="https://storage.googleapis.com/golang/go${version}.${platform}-${arch}${extra}.tar.gz"

rtn=$(vercomp ${version} 1.2)
# URL to download from
if [ "$rtn" == "1" ]
then
download="http://golang.org/dl/go${version}.${platform}-${arch}${extra}.tar.gz"
else
download="https://go.googlecode.com/files/go${version}.${platform}-${arch}${extra}.tar.gz"
fi
# Can't get too clever here
set +e

Expand Down

0 comments on commit 0e958b6

Please sign in to comment.