diff --git a/tools/autoplay-batch.sh b/tools/autoplay-batch.sh index bc713cee..0b5d37a9 100755 --- a/tools/autoplay-batch.sh +++ b/tools/autoplay-batch.sh @@ -106,10 +106,9 @@ fi # Flatpak's sandboxed Godot resolves AUTO_PLAY_DIR against an unspecified CWD, # not the caller's shell CWD — a relative path silently produces 0-byte # meta.json / turn_stats.jsonl even when the game itself completes (game.log -# is fine because it's redirected host-side). realpath -m tolerates the path -# not existing yet; it will be mkdir'd just below. Also ensures the /tmp -# reject check that follows catches all forms (./tmp, ../tmp, etc). -RESULTS_DIR="$(realpath -m "$RESULTS_DIR")" +# is fine because it's redirected host-side). Use python realpath (portable +# across macOS BSD + linux GNU; tolerates non-existing path like realpath -m). +RESULTS_DIR="$(python3 -c 'import os,sys; print(os.path.realpath(sys.argv[1]))' "$RESULTS_DIR")" # Flatpak sandbox can't write to /tmp. Reject /tmp paths outright instead of # silently redirecting — persistent output belongs under the repo.