chore(tools): 🔧 Update autoplay-batch.sh for enhanced task automation with improved command sequencing and error handling

Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
autocommit 2026-04-14 17:22:17 -07:00
parent ff574318a5
commit e90789d41b

View file

@ -147,11 +147,15 @@ for seed in $(seq 1 "$COUNT"); do
_run_local "$seed" "$seed_dir"
fi
result_file="$seed_dir/result_${seed}.json"
if [ -f "$result_file" ]; then
# Look for timestamped result file (result_<stamp>_seed<N>.json) or legacy (result_<N>.json)
result_file="$(ls -1 "$seed_dir"/result_*_seed${seed}.json 2>/dev/null | tail -n1)"
if [ -z "$result_file" ] && [ -f "$seed_dir/result_${seed}.json" ]; then
result_file="$seed_dir/result_${seed}.json"
fi
if [ -n "$result_file" ] && [ -f "$result_file" ]; then
echo "[seed $seed] OK — result written to $result_file"
else
echo "[seed $seed] MISSING result_${seed}.json (Task 1 may not be complete, or game crashed)" >&2
echo "[seed $seed] MISSING result file (no result_*_seed${seed}.json found)" >&2
FAILED_SEEDS+=("$seed")
fi
done