Skip to content

Commit d2d2286

Browse files
committed
more output refinements
1 parent 04cfc0b commit d2d2286

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

share/github-backup-utils/ghe-backup-config

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ set +o posix
1818
RED='\033[0;31m'
1919
GREEN='\033[0;32m'
2020
YELLOW='\033[0;33m'
21+
BLUE='\033[0;34m'
2122
NC='\033[0m' # No Color
2223

2324
# Assume this script lives in share/github-backup-utils/ when setting the root
@@ -187,19 +188,14 @@ if [ -n "$GHE_VERBOSE" ]; then
187188
if [ "$GHE_PARALLEL_ENABLED" != "yes" ]; then
188189
exec 3>>"$GHE_VERBOSE_LOG"
189190
else
190-
if ! echo | awk '{ print strftime("%b %d %H:%M:%S"); fflush(); }' &>/dev/null; then
191-
echo "Error: awk command failed. Please install https://www.gnu.org/software/gawk" 1>&2
192-
exit 1
193-
fi
194191
calling_script_name="$(caller | sed 's:.*/::')"
195192
date_format=$(date -u "+%FT%TZ")
196193
if [ "$TERM" = "dumb" ] || [[ "$OUTPUT_COLOR" != "yes" ]]; then
197-
#exec 3> >(awk -v c="$calling_script_name" d="$date_format" '{ print d" INFO ", c":", $0; fflush(); }' >>"$GHE_VERBOSE_LOG")
198194
exec 3> >(echo -e "$date_format INFO $calling_script_name: $*" >>"$GHE_VERBOSE_LOG")
199195
else
200196
display_info=" ${GREEN}INFO${NC} "
201-
#exec 3> >(awk '{ print d, i, c":", $0; fflush(); }' -v c="$calling_script_name" d="$date_format" i="$display_info" >>"$GHE_VERBOSE_LOG")
202-
exec 3> >(echo -e "$date_format $display_info $calling_script_name: $*" >>"$GHE_VERBOSE_LOG")
197+
display_caller="${BLUE}$calling_script_name${NC}"
198+
exec 3> >(echo -e "$date_format $display_info $display_caller: $*" >>"$GHE_VERBOSE_LOG")
203199
fi
204200
fi
205201
else

0 commit comments

Comments
 (0)