fix(benchmark): create the world folder before writing its marker

`open` replies once the world starts opening on a worker, so the save
folder may not exist yet when the benchmark writes horizon-benchmark.txt
into it. On a slower device (an Android phone) the write failed with
"No such file or directory" and the run ended before the first scene.
This commit is contained in:
feeldev
2026-10-21 17:04:34 -05:00
parent b7390d783b
commit c833fbe212
+2
View File
@@ -145,6 +145,8 @@ fn run(control: &Control, setup: Setup) -> Result<PathBuf, String> {
replace_world(&setup.game_dir)?;
control.call(&format!("open {WORLD} {SEED} creative"))?;
// The world opens on a worker: its folder may not exist yet when `open` replies.
std::fs::create_dir_all(setup.game_dir.join("saves").join(WORLD)).map_err(|e| e.to_string())?;
std::fs::write(
setup.game_dir.join("saves").join(WORLD).join(MARKER),
"Created by horizon-client --benchmark; replaced by the next run.\n",