From fe171c65f47302e1822c97dcbf1d1afb75757339 Mon Sep 17 00:00:00 2001 From: Tobias Wolf Date: Thu, 19 Dec 2024 16:58:07 +0100 Subject: [PATCH] This commit considers `$CI` to generate shorter log console output Fixes: #36 Signed-off-by: Tobias Wolf --- build | 1 + builder/make_log | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/build b/build index b125ba3..4157ed8 100755 --- a/build +++ b/build @@ -97,6 +97,7 @@ if [ "$resolve_cname" = 1 ]; then fi make_opts=( + CI="$CI" REPO="$repo" COMMIT="$commit" TIMESTAMP="$timestamp" diff --git a/builder/make_log b/builder/make_log index d262842..6de7f88 100755 --- a/builder/make_log +++ b/builder/make_log @@ -1,6 +1,6 @@ #!/usr/bin/env bash -set -eufo pipefail +set -efo pipefail target="$1" shift @@ -9,6 +9,12 @@ echo -n | cat "${@/%/.log}" > "$target.log" while IFS= read -r line; do date="$(date -u '+%Y-%m-%d %H:%M:%S')" - printf '[%s %s] %s\n' "$target" "$date" "$line" + + if [ "${CI}" == "true" ]; then + printf '[%s] %s\n' "$target" "$line" + else + printf '[%s %s] %s\n' "$target" "$date" "$line" + fi + printf '[%s] %s\n' "$date" "$line" >> "$target.log" done