Commit 9a1ba6f8 authored by Tim Hockin's avatar Tim Hockin Committed by Jeff Grafton

Don't change GOPATH or PATH in a script lib

parent 54f2c1de
...@@ -438,12 +438,19 @@ kube::util::ensure_godep_version() { ...@@ -438,12 +438,19 @@ kube::util::ensure_godep_version() {
kube::log::status "Installing godep version ${GODEP_VERSION}" kube::log::status "Installing godep version ${GODEP_VERSION}"
go install ./vendor/github.com/tools/godep/ go install ./vendor/github.com/tools/godep/
GP="$(echo $GOPATH | cut -f1 -d:)" if ! which godep >/dev/null 2>&1; then
hash -r # force bash to clear PATH cache kube::log::error "Can't find godep - is your GOPATH 'bin' in your PATH?"
PATH="${GP}/bin:${PATH}" kube::log::error " GOPATH: ${GOPATH}"
kube::log::error " PATH: ${PATH}"
return 1
fi
if [[ "$(godep version 2>/dev/null)" != *"godep ${GODEP_VERSION}"* ]]; then if [[ "$(godep version 2>/dev/null)" != *"godep ${GODEP_VERSION}"* ]]; then
kube::log::error "Expected godep ${GODEP_VERSION}, got $(godep version)" kube::log::error "Wrong godep version - is your GOPATH 'bin' in your PATH?"
kube::log::error " expected: godep ${GODEP_VERSION}"
kube::log::error " got: $(godep version)"
kube::log::error " GOPATH: ${GOPATH}"
kube::log::error " PATH: ${PATH}"
return 1 return 1
fi fi
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment