Skip to content

Commit b52c8ee

Browse files
committed
Replace Unicode symbol with ASCII status indicator
This replaces ✓/✗ symbols with [ OK ]/[ FAIL ] for better compatibility. It also standardizes printf formatting in git pre-push hook, ensuring brackets display in normal color, only status text colored. Change-Id: I4ba4f74acd36895b415648fddd9d04a1498858e0
1 parent 3c3fa14 commit b52c8ee

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

scripts/common.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
RED=""
2+
GREEN=""
23
YELLOW=""
34
BLUE=""
45
WHITE=""
@@ -11,6 +12,7 @@ set_colors() {
1112
# If color is forced (always) or auto and we are on a tty, enable color.
1213
if [[ "$default_color" == "always" ]] || [[ "$default_color" == "auto" && -t 1 ]]; then
1314
RED='\033[1;31m'
15+
GREEN='\033[1;32m'
1416
YELLOW='\033[1;33m'
1517
BLUE='\033[1;34m'
1618
WHITE='\033[1;37m'

scripts/pre-commit.hook

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ report_result() {
3131
local status="$1"
3232
local message="$2"
3333
if [ "$status" -eq 0 ]; then
34-
printf " ${GREEN}${NC}\n"
34+
printf " [ ${GREEN}OK${NC} ]\n"
3535
else
36-
printf " ${RED}${NC}\n"
36+
printf " [ ${RED}FAIL${NC} ]\n"
3737
if [ -n "$message" ]; then
3838
ERRORS_FOUND+=("$message")
3939
fi
@@ -334,8 +334,8 @@ fi
334334
# Clear the progress line
335335
printf "\r%*s\r" 50 ""
336336

337-
# === SUMMARY ===
338-
printf "\n${CYAN}=== Pre-commit Check Summary ===${NC}\n\n"
337+
# Summary
338+
printf "\n"
339339

340340
# Show file changes
341341
printf "${CYAN}Files to be committed:${NC}\n"
@@ -359,7 +359,7 @@ done
359359
if [ ${#ERRORS_FOUND[@]} -gt 0 ]; then
360360
printf "\n${RED}Errors found:${NC}\n"
361361
for error in "${ERRORS_FOUND[@]}"; do
362-
printf " ${RED}${NC} %s\n" "$error"
362+
printf " [ ${RED}FAIL${NC} ] %s\n" "$error"
363363
done
364364
fi
365365

scripts/pre-push.hook

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,18 @@ run_build_checks() {
6464
echo ""
6565

6666
# Clean previous build artifacts for fresh check
67-
echo -e "${YELLOW}Cleaning previous build...${NC}"
67+
printf "${YELLOW}Cleaning previous build...${NC}"
6868
make clean >/dev/null 2>&1 || true
69+
printf " [ ${GREEN}OK${NC} ]\n"
6970

70-
echo -e "${YELLOW}Building project...${NC}"
71+
printf "${YELLOW}Building project...${NC}"
7172

7273
# Capture build output for better error reporting
7374
build_output=$(make 2>&1)
7475
build_result=$?
7576

7677
if [ $build_result -ne 0 ]; then
77-
echo -e "${RED}Build failed!${NC}"
78+
printf " [ ${RED}FAIL${NC} ]\n"
7879
echo ""
7980
echo "Build output:"
8081
echo "============="
@@ -85,7 +86,7 @@ run_build_checks() {
8586
return 1
8687
fi
8788

88-
echo -e "${GREEN}✓ Build successful${NC}"
89+
printf " [ ${GREEN}OK${NC} ]\n"
8990

9091
# Additional checks could be added here
9192
# For example: basic tests, format checks, etc.

0 commit comments

Comments
 (0)