Wasm: Delete old output files before compiling new ones

This commit is contained in:
Brian Carroll 2022-01-07 23:30:39 +00:00
parent 6db7dbed1c
commit 8cf82ae1b3

View file

@ -156,6 +156,8 @@ fn run_linker(
let wasm_build_dir: &Path = if let Some(src_hash) = build_dir_hash {
debug_dir = format!("/tmp/roc/gen_wasm/{:016x}", src_hash);
std::fs::remove_file(format!("{}/app.o", debug_dir)).unwrap_or_else(|_| {});
std::fs::remove_file(format!("{}/final.wasm", debug_dir)).unwrap_or_else(|_| {});
std::fs::create_dir_all(&debug_dir).unwrap();
println!(
"Debug commands:\n\twasm-objdump -dx {}/app.o\n\twasm-objdump -dx {}/final.wasm",