Skip to content

Commit 3638dba

Browse files
committed
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.
1 parent 9f0ec62 commit 3638dba

File tree

1 file changed

+6
-2
lines changed
  • crates/misc/run-examples/src

1 file changed

+6
-2
lines changed

crates/misc/run-examples/src/main.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,14 @@ fn main() -> anyhow::Result<()> {
8484
.arg("ntdll.lib")
8585
.arg("shell32.lib")
8686
.arg("ole32.lib");
87-
"./main.exe"
87+
if is_dir {
88+
"main.exe".to_string()
89+
} else {
90+
format!("./{}.exe", example)
91+
}
8892
} else {
8993
cmd.arg("target/debug/libwasmtime.a").arg("-o").arg("foo");
90-
"./foo"
94+
"./foo".to_string()
9195
};
9296
if cfg!(target_os = "linux") {
9397
cmd.arg("-lpthread").arg("-ldl").arg("-lm");

0 commit comments

Comments
 (0)