From 1f07b89c2c34e7e652aa66894fd0913dce561653 Mon Sep 17 00:00:00 2001 From: kami Date: Sat, 29 Aug 2026 19:23:17 +0400 Subject: [PATCH] Rig: move the tree after phase-1 was signed off --- scripts/orchestra_e2e_healthcheck.sh | 30 +++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/scripts/orchestra_e2e_healthcheck.sh b/scripts/orchestra_e2e_healthcheck.sh index f6fa7ee..34e174e 100755 --- a/scripts/orchestra_e2e_healthcheck.sh +++ b/scripts/orchestra_e2e_healthcheck.sh @@ -10,6 +10,14 @@ selftest_present test_healthcheck_present readme_present no_crlf_line_endings no_tabs_in_scripts shebang_is_bash usage_text_mentions_every_flag" +# check_exists : true when is one of the CHECKS names. +check_exists() { + case " $(printf '%s ' $CHECKS) " in + *" $1 "*) return 0 ;; + esac + return 1 +} + # name=ok / name=fail pairs, in run order. RESULTS= FAILED=0 @@ -103,8 +111,16 @@ main() { local timing= local strict= local unknown= + local only= + local expect_only= for arg in "$@"; do - if [ "$arg" = --help ]; then + if [ -n "$expect_only" ]; then + only=$arg + expect_only= + continue + elif [ "$arg" = --only ]; then + expect_only=1 + elif [ "$arg" = --help ]; then usage text exit 0 elif [ "$arg" = --list-checks ]; then @@ -128,6 +144,16 @@ main() { fi done + if [ -n "$expect_only" ]; then + printf -- '--only requires a check name\n' >&2 + exit 2 + fi + + if [ -n "$only" ] && ! check_exists "$only"; then + printf 'unknown check: %s\n' "$only" >&2 + exit 2 + fi + if [ -n "$strict" ] && [ -n "$unknown" ]; then printf 'unknown flag: %s\n' "$unknown" >&2 exit 2 @@ -180,3 +206,5 @@ main() { } main "$@" + +# Rig: an operator edit made after phase-1 was signed off.