From 8ea3c7d1ae8fd960897344694645117adbd8ee82 Mon Sep 17 00:00:00 2001 From: kami Date: Sat, 29 Aug 2026 17:46:50 +0400 Subject: [PATCH] orchestra: pre-release WIP snapshot (orchestra-06g4vf5hzw7q4jbm3tty7w1y64-4d839c05) --- scripts/orchestra_e2e_healthcheck.sh | 54 +++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/scripts/orchestra_e2e_healthcheck.sh b/scripts/orchestra_e2e_healthcheck.sh index f7b9a38..7058821 100755 --- a/scripts/orchestra_e2e_healthcheck.sh +++ b/scripts/orchestra_e2e_healthcheck.sh @@ -1,6 +1,41 @@ #!/usr/bin/env bash readonly VERSION=1.0.0 +readonly ROOT=$(cd "$(dirname "$0")/.." && pwd) + +# Space-separated check names; each has a check_ function. +CHECKS="repo_root_readable scripts_dir_present healthcheck_executable_bit +selftest_present test_healthcheck_present readme_present +no_crlf_line_endings no_tabs_in_scripts" + +# name=ok / name=fail pairs, in run order. +RESULTS= +FAILED=0 +TOTAL=0 + +# record : append one outcome to the results state. +record() { + RESULTS="$RESULTS $1=$2" + TOTAL=$((TOTAL + 1)) + [ "$2" = ok ] || FAILED=$((FAILED + 1)) +} + +check_repo_root_readable() { [ -d "$ROOT" ] && [ -r "$ROOT" ]; } +check_scripts_dir_present() { [ -d "$ROOT/scripts" ]; } +check_healthcheck_executable_bit() { [ -x "$ROOT/scripts/orchestra_e2e_healthcheck.sh" ]; } +check_selftest_present() { [ -f "$ROOT/scripts/orchestra_e2e_selftest.sh" ]; } +check_test_healthcheck_present() { [ -f "$ROOT/scripts/test_healthcheck.sh" ]; } +check_readme_present() { [ -f "$ROOT/README.md" ]; } + +check_no_crlf_line_endings() { + [ -d "$ROOT/scripts" ] || return 1 + ! grep -qU $'\r' "$ROOT"/scripts/*.sh "$ROOT/README.md" 2>/dev/null +} + +check_no_tabs_in_scripts() { + [ -d "$ROOT/scripts" ] || return 1 + ! grep -q "$(printf '\t')" "$ROOT"/scripts/*.sh 2>/dev/null +} # emit