mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 15:37:24 +00:00
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.
This commit is contained in:
@@ -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[@]}"
|
||||
|
||||
Reference in New Issue
Block a user