Fix non-release builds

This commit is contained in:
Brooks J Rady 2021-02-09 23:59:28 +00:00
parent 4f199d5d35
commit d28b66a2a7

View file

@ -60,6 +60,7 @@ fn main() {
}
set_current_dir(&starting_dir);
if var("PROFILE").unwrap() == "release" {
// FIXME: Deduplicate this with the initial walk all .rs pattern
for entry in fs::read_dir(alt_target.join("wasm32-wasi/release/")).unwrap() {
let entry = entry.unwrap().path();
@ -75,7 +76,17 @@ fn main() {
entry.file_name().unwrap().to_string_lossy()
))
.status()
.unwrap();
.unwrap_or_else(|_| {
Command::new("cp")
.arg(entry.as_os_str())
.arg(format!(
"assets/plugins/{}",
entry.file_name().unwrap().to_string_lossy()
))
.status()
.unwrap()
});
}
}
}