From 3d03b4b80f722f00e8f125676f48ec78c881f4cf Mon Sep 17 00:00:00 2001 From: Filipe Brandenburger Date: Wed, 3 Sep 2014 14:58:45 -0700 Subject: [PATCH] Also assume arguments starting with dashes are go flags in `hack/build-go.sh` Tested: $ hack/build-go.sh cmd/kubelet -v github.com/GoogleCloudPlatform/kubernetes/pkg/... Signed-off-by: Filipe Brandenburger --- hack/build-go.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/hack/build-go.sh b/hack/build-go.sh index 0f4c2c07d1b..a6075fddbaa 100755 --- a/hack/build-go.sh +++ b/hack/build-go.sh @@ -44,14 +44,19 @@ if [[ $# == 0 ]]; then plugin/cmd/scheduler fi -binaries=() -for arg; do - binaries+=("${KUBE_GO_PACKAGE}/${arg}") -done - # Use eval to preserve embedded quoted strings. eval "goflags=(${GOFLAGS:-})" +binaries=() +for arg; do + if [[ "${arg}" == -* ]]; then + # Assume arguments starting with a dash are flags to pass to go. + goflags+=("${arg}") + else + binaries+=("${KUBE_GO_PACKAGE}/${arg}") + fi +done + # Note that the flags to 'go build' are duplicated in the salt build setup # (release/build-release.sh) for our cluster deploy. If we add more command # line options to our standard build we'll want to duplicate them there. As we