diff --git a/scripts/build.sh b/scripts/build.sh index 543b22b99f..ed0dc6ef4e 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -15,9 +15,9 @@ DIR="$( cd -P "$( dirname "$SOURCE" )/.." && pwd )" cd "$DIR" # Get the git commit -GIT_COMMIT=$(git rev-parse HEAD) -GIT_DIRTY=$(test -n "`git status --porcelain`" && echo "+CHANGES" || true) -GIT_DESCRIBE=$(git describe --tags) +GIT_COMMIT="$(git rev-parse HEAD)" +GIT_DIRTY="$(test -n "`git status --porcelain`" && echo "+CHANGES" || true)" +GIT_DESCRIBE="$(git describe --tags)" # Determine the arch/os combos we're building for XC_ARCH=${XC_ARCH:-"386 amd64 arm"} @@ -40,7 +40,7 @@ echo "==> Building..." $GOPATH/bin/gox \ -os="${XC_OS}" \ -arch="${XC_ARCH}" \ - -ldflags "-X main.GitCommit ${GIT_COMMIT}${GIT_DIRTY} -X main.GitDescribe ${GIT_DESCRIBE}" \ + -ldflags "-X main.GitCommit='${GIT_COMMIT}${GIT_DIRTY}' -X main.GitDescribe='${GIT_DESCRIBE}'" \ -output "pkg/{{.OS}}_{{.Arch}}/consul" \ .