From 472a6ccbf7da5699ebe6240ba10f9932907bad98 Mon Sep 17 00:00:00 2001 From: Jordan Bancino Date: Sat, 7 Jan 2023 19:14:15 +0000 Subject: [PATCH] Clean up build output on terminals. If we're not writing out to a terminal, then echo each file out as it is being compiled. Otherwise, if we are on a terminal, overwrite the previous line. --- tools/bin/td | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/bin/td b/tools/bin/td index 9f5883c..bd86bba 100644 --- a/tools/bin/td +++ b/tools/bin/td @@ -93,7 +93,11 @@ recipe_build() { objs="$objs $obj" if [ $(mod_time "$src") -ge $(mod_time "$obj") ]; then - echo "CC $(basename $obj)" + if [ -t 1 ]; then + printf "CC %s\t\t\t\r" "$(basename $obj)" + else + echo "CC $(basename $obj)" + fi obj_dir=$(dirname "$obj") mkdir -p "$obj_dir" if ! $CC $CFLAGS -Iinclude -c -o "$obj" "$src"; then