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 <noreply@anthropic.com>
This commit is contained in:
+1
-1
@@ -115,7 +115,7 @@ for i in $(seq $((N+1)) 10); do
|
|||||||
sed -i "s|^Sheep .* \"sheep${i}\".*|# &|" "$DST"
|
sed -i "s|^Sheep .* \"sheep${i}\".*|# &|" "$DST"
|
||||||
done
|
done
|
||||||
|
|
||||||
active=$(grep -c '^Sheep' "$DST")
|
active=$(grep -c '^Sheep' "$DST" || true)
|
||||||
echo "------------------------------------------------------------"
|
echo "------------------------------------------------------------"
|
||||||
echo "World : $DST"
|
echo "World : $DST"
|
||||||
echo "Mode : $MODE"
|
echo "Mode : $MODE"
|
||||||
|
|||||||
Reference in New Issue
Block a user