Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This commit considers $CI to generate shorter log console output #101

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if $CI is the most intuitive control var name.... maybe make it more explicit what this dose, along the lines of NO_PRINT_TIMESTAMPS or something 🤔

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removing the set -u is not great (might result in uncaught errors down the line).... instead of relying on this, please do something like "${CI:-false}" to handle cases where $CI is not set.


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 [ "${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
Loading