Merge pull request #62 from markdryan/gopath-setup

utils: Use go env to discover the GOPATH
This commit is contained in:
Sebastien Boeuf 2018-03-16 10:35:10 -07:00 committed by GitHub
commit 65012d08b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,11 +19,13 @@ set -e
SCRIPT_PATH=$(dirname $(readlink -f $0))
if [[ -z "$GOPATH" ]]; then
echo "This script requires GOPATH to be set. You may need to invoke via 'sudo -E PATH=$PATH ./virtcontainers-setup.sh'"
if [ ! $(command -v go) ]; then
echo "This script requires go to be installed and executable"
exit 1
fi
GOPATH=$(go env "GOPATH")
if [ ! $(command -v docker) ]; then
echo "This script requires docker to be installed and executable"
exit 1