Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
Merge pull request #62 from markdryan/gopath-setup
Browse files Browse the repository at this point in the history
utils: Use go env to discover the GOPATH
  • Loading branch information
Sebastien Boeuf authored Mar 16, 2018
2 parents d1bdf80 + 96c4977 commit 65012d0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions virtcontainers/utils/virtcontainers-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 65012d0

Please sign in to comment.