Fixed a make build issue with Windows Binaries. (#4538)

* Fixed an issue where Windows binary had trouble being copied correctly

* Enclosed binname inside angular brackets
pull/4539/head
Siva Prasad 2018-08-17 09:31:57 -04:00 committed by GitHub
parent 9257300f7e
commit f8cc241b28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -464,7 +464,11 @@ function build_consul_local {
then
GOBIN_EXTRA="${os}_${arch}/"
fi
CGO_ENABLED=0 GOOS=${os} GOARCH=${arch} go install -ldflags "${GOLDFLAGS}" -tags "${GOTAGS}" && cp "${MAIN_GOPATH}/bin/${GOBIN_EXTRA}consul" "${outdir}/consul"
binname="consul"
if [ $os == "windows" ];then
binname="consul.exe"
fi
CGO_ENABLED=0 GOOS=${os} GOARCH=${arch} go install -ldflags "${GOLDFLAGS}" -tags "${GOTAGS}" && cp "${MAIN_GOPATH}/bin/${GOBIN_EXTRA}${binname}" "${outdir}/${binname}"
if test $? -ne 0
then
err "ERROR: Failed to build Consul for ${osarch}"