From 03b2df5656fabbec2514b4983bf16b07ce2de258 Mon Sep 17 00:00:00 2001 From: Johnny Fernandes Date: Sat, 16 May 2026 20:40:28 +0000 Subject: [PATCH] Fix run_webots.sh exit-1 when N=0 (calibration mode) `active=$(grep -c '^Sheep' "$DST")` returns 0 with exit code 1 when no sheep are left in the world, which fires set -e and kills the script before it can launch Webots. Wrap with `|| true` so the calibration mode (N=0) can actually run. Co-Authored-By: Claude Opus 4.7 --- tools/run_webots.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/run_webots.sh b/tools/run_webots.sh index 8c8a759..3263a86 100755 --- a/tools/run_webots.sh +++ b/tools/run_webots.sh @@ -115,7 +115,7 @@ for i in $(seq $((N+1)) 10); do sed -i "s|^Sheep .* \"sheep${i}\".*|# &|" "$DST" done -active=$(grep -c '^Sheep' "$DST") +active=$(grep -c '^Sheep' "$DST" || true) echo "------------------------------------------------------------" echo "World : $DST" echo "Mode : $MODE"