1. Removed the check_go_version script
2. Only check go version in bootstrap
3. Simplify the go version check logic
This commit is contained in:
Pepper Lebeck-Jobe 2017-05-15 13:03:14 +09:00
Родитель 97dade5936
Коммит e3518167df
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 28D364DD30E03818
3 изменённых файлов: 5 добавлений и 46 удалений

Просмотреть файл

@ -1,6 +1,5 @@
#!/usr/bin/env bash
set -e
source script/check_go_version
STATUS=0
@ -17,7 +16,11 @@ if [ -n "$TRAVIS" ] && [ ! -x ~/bin/tmux ]; then
curl -fsSL "https://${AMAZON_S3_BUCKET}.s3.amazonaws.com/${cache_name}.tgz" | tar -xz -C ~
fi
check_go_version
go_ver="$(go version | grep -o '1.[[:digit:]]\+' | head -1)"
if [ "${go_ver#*.}" -lt 8 ]; then
echo "You need to install Go 1.8 or higher to build hub" >&2
STATUS=1
fi
{ ruby --version
if [ -n "$TRAVIS" ]; then

Просмотреть файл

@ -8,9 +8,6 @@
# With `test`, runs tests instead.
set -e
source script/check_go_version
check_go_version
windows=
[[ $OS == Windows* ]] && windows=1

Просмотреть файл

@ -1,41 +0,0 @@
#!/usr/bin/env bash
# This script is only used by importing into other scripts.
GO_VERSION_REGEX="go(1\.[89]|[2-9]\.[0-9]{1,}|[0-9]{2,}\.[0-9]{1,})(\.[0-9]{1,})?[[:space:]]"
check_go_version() {
if ! go version | grep -E $GO_VERSION_REGEX &> /dev/null; then
echo "You need to install Go 1.8 or higher to build hub" >&2
exit 1
else
go version
fi
}
test_go_version() {
if ! echo $1 | grep -E $GO_VERSION_REGEX &> /dev/null; then
echo "FAIL $1" >&2
else
echo "PASS $1"
fi
}
test_go_versions() {
test_go_version "go version go0.1 darwin/amd64"
test_go_version "go version go0.2 darwin/amd64"
test_go_version "go version go1.6 darwin/amd64"
test_go_version "go version go1.7.8 darwin/amd64"
test_go_version "go version go1.8 darwin/amd64"
test_go_version "go version go1.8.1 darwin/amd64"
test_go_version "go version go1.8.10 darwin/amd64"
test_go_version "go version go1.9 darwin/amd64"
test_go_version "go version go2.0 darwin/amd64"
test_go_version "go version go2.0.1 darwin/amd64"
test_go_version "go version go3.1 darwin/amd64"
test_go_version "go version go4.5 darwin/amd64"
test_go_version "go version go5.6 darwin/amd64"
test_go_version "go version go6.7 darwin/amd64"
test_go_version "go version go10.1 darwin/amd64"
test_go_version "go version go10.1 darwin/amd64"
test_go_version "go version go10.10.10 darwin/amd64"
}