From 54af7060326d8c6f1e21f814886056d003615d05 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 25 Jun 2025 22:25:21 +1200 Subject: [PATCH] Modify buildtestpublish_all.sh --- buildtestpublish_all.sh | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/buildtestpublish_all.sh b/buildtestpublish_all.sh index 3dd9164..87c4504 100755 --- a/buildtestpublish_all.sh +++ b/buildtestpublish_all.sh @@ -2,6 +2,12 @@ set -uo pipefail # Remove -e to handle errors manually SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +# Colors for output +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +NC='\033[0m' # No Color + # Arrays to track results declare -A BUILD_RESULTS declare -A TEST_RESULTS @@ -166,9 +172,36 @@ function print_summary() { local test_status="${TEST_RESULTS[$project]:-'-'}" local publish_status="${PUBLISH_RESULTS[$project]:-'-'}" - printf "│ %-*s │ %-7s │ %-7s │ %-7s │\n" \ + # Format status with proper spacing and colors for Unicode characters + local build_col test_col publish_col + + # Format build status + case "$build_status" in + "✓") build_col=" ${GREEN}✓${NC} " ;; + "✗") build_col=" ${RED}✗${NC} " ;; + "SKIP") build_col=" ${YELLOW}-${NC} " ;; + *) build_col=" - " ;; + esac + + # Format test status + case "$test_status" in + "✓") test_col=" ${GREEN}✓${NC} " ;; + "✗") test_col=" ${RED}✗${NC} " ;; + "SKIP") test_col=" ${YELLOW}-${NC} " ;; + *) test_col=" - " ;; + esac + + # Format publish status + case "$publish_status" in + "✓") publish_col=" ${GREEN}✓${NC} " ;; + "✗") publish_col=" ${RED}✗${NC} " ;; + "SKIP") publish_col=" ${YELLOW}-${NC} " ;; + *) publish_col=" - " ;; + esac + + printf "│ %-*s │%b│%b│%b│\n" \ $max_project_width "$project" \ - "$build_status" "$test_status" "$publish_status" + "$build_col" "$test_col" "$publish_col" done # Print bottom border