diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2024-05-24 14:32:26 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2024-05-24 14:32:26 -0400 |
commit | c2fee54077be069eb666621b006635580826d2a4 (patch) | |
tree | 93352ea427ef2b203467454e7e77c6b4842201b4 | |
parent | 82bfda9af2e4a720ff485302307b2b50584efb8e (diff) | |
download | bfs-c2fee54077be069eb666621b006635580826d2a4.tar.xz |
configure: Color the checkmarks
-rwxr-xr-x | build/msg-if.sh | 14 |
1 files changed, 12 insertions, 2 deletions
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")" |