allow for testing go:tip

This commit is contained in:
Josh Baker 2016-03-17 12:15:35 -07:00
parent d178133383
commit 865bbf7d19
1 changed files with 41 additions and 40 deletions

View File

@ -14,12 +14,16 @@ if [ "$PROTECTED_MODE" == "no" ]; then
LDFLAGS="$LDFLAGS -X github.com/tidwall/tile38/core.ProtectedMode=no"
fi
# Check go install
if [ "$(which go)" == "" ]; then
echo "error: Go is not installed. Please download and follow installation instructions at https://golang.org/dl to continue."
exit 1
fi
vercomp () {
# Check go version
GOVERS="$(go version | cut -d " " -f 3)"
if [ "$GOVERS" != "devel" ]; then
vercomp () {
if [[ $1 == $2 ]]
then
echo "0"
@ -52,11 +56,8 @@ vercomp () {
done
echo "0"
return
}
GOVERS="$(go version | cut -d " " -f 3)"
GOVERS="${GOVERS:2}"
if [ "$GOVERS" != "devel" ]; then
}
GOVERS="${GOVERS:2}"
EQRES=$(vercomp "$GOVERS" "1.5")
if [ "$EQRES" == "-1" ]; then
echo "error: Go '1.5' or greater is required and '$GOVERS' is currently installed. Please upgrade Go at https://golang.org/dl to continue."