From 3638dba855c0a73e6a99d131ccc539ce8ffc238a Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Mon, 13 Jul 2020 08:56:32 -0700 Subject: [PATCH] examples: Run the correct example executable on Windows We were accidentally always running the `fib-debug/main` example because of shenanigans with alphabetical ordering and hard coding "main.exe" as the command we run. Now we properly detect which example we built and run the appropriate executable. --- crates/misc/run-examples/src/main.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/misc/run-examples/src/main.rs b/crates/misc/run-examples/src/main.rs index 358b738311..94e5b56dc9 100644 --- a/crates/misc/run-examples/src/main.rs +++ b/crates/misc/run-examples/src/main.rs @@ -84,10 +84,14 @@ fn main() -> anyhow::Result<()> { .arg("ntdll.lib") .arg("shell32.lib") .arg("ole32.lib"); - "./main.exe" + if is_dir { + "main.exe".to_string() + } else { + format!("./{}.exe", example) + } } else { cmd.arg("target/debug/libwasmtime.a").arg("-o").arg("foo"); - "./foo" + "./foo".to_string() }; if cfg!(target_os = "linux") { cmd.arg("-lpthread").arg("-ldl").arg("-lm");