From 166099abca3b82e3c7733a8683c6dae0c61067b1 Mon Sep 17 00:00:00 2001 From: Pigbibi <20649888+Pigbibi@users.noreply.github.com> Date: Wed, 24 Jun 2026 19:44:14 +0800 Subject: [PATCH] Make workflow test compatible with macOS bash --- tests/test_workflow_shared_config.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/test_workflow_shared_config.sh b/tests/test_workflow_shared_config.sh index 96ff9c6..1a3b967 100644 --- a/tests/test_workflow_shared_config.sh +++ b/tests/test_workflow_shared_config.sh @@ -79,8 +79,15 @@ grep -Fq 'sudo systemctl status "\${IBKR_GATEWAY_HEALTHCHECK_TIMER}" --no-pager' grep -Fq 'sudo systemctl status "\${IBKR_GATEWAY_DAILY_RESTART_TIMER}" --no-pager' "$workflow_file" grep -Fq 'Full deploy mode: rebuilding container' "$workflow_file" -mapfile -t recover_lines < <(grep -nF "bash ./scripts/recover_ib_gateway_ready.sh '\${IB_GATEWAY_MODE}'" "$workflow_file" | cut -d: -f1) -mapfile -t health_watcher_lines < <(grep -nF 'bash ./scripts/install_gateway_health_watcher.sh' "$workflow_file" | cut -d: -f1) +recover_lines=() +while IFS= read -r line_number; do + recover_lines+=("$line_number") +done < <(grep -nF "bash ./scripts/recover_ib_gateway_ready.sh '\${IB_GATEWAY_MODE}'" "$workflow_file" | cut -d: -f1) + +health_watcher_lines=() +while IFS= read -r line_number; do + health_watcher_lines+=("$line_number") +done < <(grep -nF 'bash ./scripts/install_gateway_health_watcher.sh' "$workflow_file" | cut -d: -f1) test "${#recover_lines[@]}" -eq 2 test "${#health_watcher_lines[@]}" -eq 2 for i in 0 1; do