Skip to content

Commit

Permalink
This commit considers $CI to generate shorter log console output
Browse files Browse the repository at this point in the history
Fixes: #36
Signed-off-by: Tobias Wolf <[email protected]>
  • Loading branch information
NotTheEvilOne committed Dec 19, 2024
1 parent b399457 commit aeab082
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ if [ "$resolve_cname" = 1 ]; then
fi

make_opts=(
CI="$CI"
REPO="$repo"
COMMIT="$commit"
TIMESTAMP="$timestamp"
Expand Down
10 changes: 8 additions & 2 deletions builder/make_log
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

set -eufo pipefail
set -efo pipefail

target="$1"
shift
Expand All @@ -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 [ "x${CI}" == "xtrue" ]; then

Check warning

Code scanning / shellcheck

SC2268 Warning

Avoid x-prefix in comparisons as it no longer serves a purpose.
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

0 comments on commit aeab082

Please sign in to comment.