From c2fee54077be069eb666621b006635580826d2a4 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Fri, 24 May 2024 14:32:26 -0400 Subject: configure: Color the checkmarks --- build/msg-if.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'build') diff --git a/build/msg-if.sh b/build/msg-if.sh index e0d0957..afb478c 100755 --- a/build/msg-if.sh +++ b/build/msg-if.sh @@ -14,8 +14,18 @@ set -eu MSG="$1" shift +if [ -z "${NO_COLOR:-}" ] && [ -t 1 ]; then + Y='\033[1;32m✔\033[0m' + N='\033[1;31m✘\033[0m' +else + Y='✔' + N='✘' +fi + if "$@"; then - build/msg.sh "$(printf '%-37s ✔' "$MSG")" + YN="$Y" else - build/msg.sh "$(printf '%-37s ✘' "$MSG")" + YN="$N" fi + +build/msg.sh "$(printf "%-37s $YN" "$MSG")" -- cgit v1.2.3