summaryrefslogtreecommitdiffstats
path: root/build/msg-if.sh
diff options
context:
space:
mode:
Diffstat (limited to 'build/msg-if.sh')
-rwxr-xr-xbuild/msg-if.sh18
1 files changed, 14 insertions, 4 deletions
diff --git a/build/msg-if.sh b/build/msg-if.sh
index 8112aea..afb478c 100755
--- a/build/msg-if.sh
+++ b/build/msg-if.sh
@@ -6,16 +6,26 @@
# Print a success/failure indicator from a makefile:
#
# $ ./configure
-# [ CC ] use/liburing.c ✘
-# [ CC ] use/oniguruma.c ✔
+# [ CC ] with/liburing.c ✘
+# [ CC ] with/oniguruma.c ✔
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")"