From 8d2b029074a5ed55e0601966e84a2d815e4fd7e8 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 1 May 2014 10:55:54 -0700 Subject: [PATCH] Split GOPATH properly on Windows builds --- scripts/build.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/build.sh b/scripts/build.sh index 773fc4392..10eaabd44 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -21,6 +21,11 @@ if [ "$(go env GOOS)" = "windows" ]; then EXTENSION=".exe" fi +GOPATHSINGLE=${GOPATH%%:*} +if [ "$(go env GOOS)" = "windows" ]; then + GOPATHSINGLE=${GOPATH%%;*} +fi + # Install dependencies echo "--> Installing dependencies to speed up builds..." go get ./... @@ -31,4 +36,4 @@ go build \ -ldflags "-X main.GitCommit ${GIT_COMMIT}${GIT_DIRTY}" \ -v \ -o bin/consul${EXTENSION} -cp bin/consul${EXTENSION} ${GOPATH%%:*}/bin +cp bin/consul${EXTENSION} ${GOPATHSINGLE}/bin