From 9ce855269e312d8d6af3a26e56d9dd89e9c05b17 Mon Sep 17 00:00:00 2001 From: Marcin Owsiany Date: Wed, 13 Apr 2016 10:49:18 +0200 Subject: [PATCH] Fix spacing in usage_from_stdin and info_from_stdin (issue #24186). If "a" is a bash array, then the syntax to append the contents of $line as a new element to the array is a+=("$line"), not messages+=$line Using the former syntax just seems to append to the first element, creating a long string and thus losing newline information. Fixing this allows us to drop some empty lines from invocations of usage_from_stdin. --- cluster/lib/logging.sh | 4 ++-- hack/lib/golang.sh | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/cluster/lib/logging.sh b/cluster/lib/logging.sh index 0b10772eb9..6bcebaa920 100644 --- a/cluster/lib/logging.sh +++ b/cluster/lib/logging.sh @@ -106,7 +106,7 @@ kube::log::usage() { kube::log::usage_from_stdin() { local messages=() while read -r line; do - messages+=$line + messages+=("$line") done kube::log::usage "${messages[@]}" @@ -129,7 +129,7 @@ kube::log::progress() { kube::log::info_from_stdin() { local messages=() while read -r line; do - messages+=$line + messages+=("$line") done kube::log::info "${messages[@]}" diff --git a/hack/lib/golang.sh b/hack/lib/golang.sh index 4cbb3560f2..dadc6d7d30 100755 --- a/hack/lib/golang.sh +++ b/hack/lib/golang.sh @@ -264,10 +264,8 @@ kube::golang::setup_env() { if [[ -z "$(which go)" ]]; then kube::log::usage_from_stdin <