make hack/config-go.sh sourceable from zsh

This commit is contained in:
Kouhei Ueno 2014-07-12 15:37:24 +09:00
parent 89655584eb
commit 663b80b6a3

View File

@ -17,7 +17,7 @@
# This script sets up a go workspace locally and builds all go components. # This script sets up a go workspace locally and builds all go components.
# You can 'source' this file if you want to set up GOPATH in your local shell. # You can 'source' this file if you want to set up GOPATH in your local shell.
if [ "$(which go)" == "" ]; then if [[ "$(which go)" == "" ]]; then
echo "Can't find 'go' in PATH, please fix and retry." echo "Can't find 'go' in PATH, please fix and retry."
echo "See http://golang.org/doc/install for installation instructions." echo "See http://golang.org/doc/install for installation instructions."
exit 1 exit 1
@ -29,7 +29,7 @@ fi
if [ "${TRAVIS}" != "true" ]; then if [ "${TRAVIS}" != "true" ]; then
GO_VERSION=($(go version)) GO_VERSION=($(go version))
if [ ${GO_VERSION[2]} \< "go1.2" ]; then if [[ ${GO_VERSION[2]} < "go1.2" ]]; then
echo "Detected go version: ${GO_VERSION}." echo "Detected go version: ${GO_VERSION}."
echo "Kubernetes requires go version 1.2 or greater." echo "Kubernetes requires go version 1.2 or greater."
echo "Please install Go version 1.2 or later" echo "Please install Go version 1.2 or later"
@ -37,10 +37,9 @@ if [ "${TRAVIS}" != "true" ]; then
fi fi
fi fi
pushd $(dirname "${BASH_SOURCE}")/.. >/dev/null KUBE_REPO_REL_ROOT="$(dirname ${BASH_SOURCE:-$0})/.."
KUBE_REPO_ROOT="${PWD}" KUBE_REPO_ROOT="$(readlink -f ${KUBE_REPO_REL_ROOT})"
KUBE_TARGET="${KUBE_REPO_ROOT}/output/go" KUBE_TARGET="${KUBE_REPO_ROOT}/output/go"
popd >/dev/null
mkdir -p "${KUBE_TARGET}" mkdir -p "${KUBE_TARGET}"