fixes on describe

This commit is contained in:
2026-07-30 09:19:47 -06:00
parent 6d72f85103
commit dfd4b7e98f
6 changed files with 132 additions and 50 deletions
+35
View File
@@ -0,0 +1,35 @@
#!/usr/bin/env bash
BOLD="\033[1m"
RESET="\033[0m"
SUCCESS="\033[38;2;80;220;100m"
FAIL="\033[38;2;255;90;90m"
INFO="\033[38;2;100;200;255m"
DIM="\033[2m"
LOG="./out/out.log"
# Start
printf "${DIM}────────────────────────────────────────${RESET}\n"
printf "${INFO}${BOLD}> Running...${RESET}\n"
printf "${DIM}────────────────────────────────────────${RESET}\n\n"
# Send both stdout and stderr to the console and the log file.
start=$(date +%s.%N)
./out/out "$@" 2>&1 | tee "$LOG"
status=${PIPESTATUS[0]}
end=$(date +%s.%N)
elapsed=$(awk "BEGIN { printf \"%.3f\", $end - $start }")
# Status!
printf "\n${DIM}────────────────────────────────────────${RESET}\n"
if (( status == 0 )); then
printf "${SUCCESS}${BOLD}✓ Success${RESET} (exit %d)\n" "$status"
else
printf "${FAIL}${BOLD}✗ Failed${RESET} (exit %d)\n" "$status"
fi
printf "${INFO}${BOLD}> Time${RESET} ${elapsed}s\n"
printf "${INFO}${BOLD}> Log${RESET} %s\n" "$LOG"
printf "${DIM}────────────────────────────────────────${RESET}"
exit "$status"