Skip to content

Commit

Permalink
Clean up previous bundle if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
TimJentzsch committed Dec 23, 2024
1 parent 70b55fc commit 5954cbd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/web/bundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,13 @@ pub fn create_web_bundle(
.join(profile)
.join(bin_target.bin_name);

// Remove the previous bundle
// The error can be ignored, because the folder doesn't need to exist yet
// and the files will also be overwritten if they already exist
let _ = fs::remove_dir_all(&base_path);

// Build artifacts
fs::create_dir_all(base_path.join("build"))?;
println!("Create build folder");
fs::copy(
linked.build_artifact_path.join(&linked.wasm_file_name),
base_path.join("build").join(&linked.wasm_file_name),
Expand Down

0 comments on commit 5954cbd

Please sign in to comment.