From d7fefb6f394923587b162002fe4be9176fa0f672 Mon Sep 17 00:00:00 2001 From: Eric Paris Date: Fri, 17 Apr 2015 11:06:37 -0400 Subject: [PATCH] Indicate progress when doing a go build It is slow. --- hack/lib/golang.sh | 3 +++ hack/lib/logging.sh | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/hack/lib/golang.sh b/hack/lib/golang.sh index db816c7aae..3f3f0be768 100644 --- a/hack/lib/golang.sh +++ b/hack/lib/golang.sh @@ -295,6 +295,7 @@ kube::golang::build_binaries_for_platform() { output_path="${output_path}/${platform//\//_}" fi + kube::log::progress " " for binary in "${binaries[@]}"; do local bin=$(basename "${binary}") if [[ ${GOOS} == "windows" ]]; then @@ -312,7 +313,9 @@ kube::golang::build_binaries_for_platform() { -ldflags "${version_ldflags}" \ "${binary}" fi + kube::log::progress "*" done + kube::log::progress "\n" else # Use go install. if [[ "${#nonstatics[@]}" != 0 ]]; then diff --git a/hack/lib/logging.sh b/hack/lib/logging.sh index 55394cb434..00dc5a626a 100644 --- a/hack/lib/logging.sh +++ b/hack/lib/logging.sh @@ -119,6 +119,13 @@ kube::log::info() { done } +# Just like kube::log::info, but no \n, so you can make a progress bar +kube::log::progress() { + for message; do + echo -e -n "$message" + done +} + kube::log::info_from_stdin() { local messages=() while read -r line; do