fix embedded rust on windows

This commit is contained in:
TudbuT 2023-08-04 21:57:54 +02:00
parent 920e9c2ff1
commit 52d4964435
3 changed files with 24 additions and 3 deletions

2
Cargo.lock generated
View file

@ -22,7 +22,7 @@ checksum = "b03f7fbd470aa8b3ad163c85cce8bccfc11cc9c44ef12da0a4eddd98bd307352"
[[package]]
name = "spl"
version = "0.1.2"
version = "0.1.4"
dependencies = [
"multicall",
"once_cell",

View file

@ -1,6 +1,6 @@
[package]
name = "spl"
version = "0.1.3"
version = "0.1.4"
edition = "2021"
description = "Stack Pogramming Language: A simple, concise scripting language."
license = "MIT"

View file

@ -173,7 +173,28 @@ impl RustAppBuilder {
.unwrap()
.wait_with_output()?;
Ok(RustApp {
binary: format!("{tmp}/spl-{name}/target/release/spl-{name}"),
binary: {
// insanity. will have to clean this up at some point.
let dir = format!("{tmp}/spl-{name}/target/release/");
fs::read_dir(dir)
.expect("unable to build: dir was not created.")
.filter(|x| {
let x = x
.as_ref()
.expect("file system did something i cannot comprehend");
let n = x.file_name().into_string().unwrap();
x.file_type().expect("file system uhhh?????").is_file()
&& !n.ends_with(".d")
&& !n.starts_with(".")
})
.next()
.expect("cargo was unable to build the binary")
.expect("file system did something i cannot comprehend")
.path()
.into_os_string()
.into_string()
.expect("bad unicode in file path")
},
})
}
}