From 766e28d64df87c8171b68c10f2df5a13b8eeee40 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 30 Dec 2022 15:22:11 +1000 Subject: [PATCH] Clean up build artifacts between runs --- build/runner/src/bundle/artifacts.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build/runner/src/bundle/artifacts.rs b/build/runner/src/bundle/artifacts.rs index 9de0f317e..b9e4dcf0f 100644 --- a/build/runner/src/bundle/artifacts.rs +++ b/build/runner/src/bundle/artifacts.rs @@ -22,6 +22,10 @@ pub fn build_artifacts(args: BuildArtifactsArgs) { fs::remove_dir_all(&artifacts).unwrap(); } let bundle_root = args.bundle_root.canonicalize_utf8().unwrap(); + let build_folder = bundle_root.join("build"); + if build_folder.exists() { + fs::remove_dir_all(&build_folder).unwrap(); + } run_silent( Command::new(&args.pyoxidizer_bin) @@ -34,7 +38,7 @@ pub fn build_artifacts(args: BuildArtifactsArgs) { "out/bundle/pyenv", "--var", "build", - bundle_root.join("build").as_str(), + build_folder.as_str(), ]) .env("CARGO_MANIFEST_DIR", "qt/bundle") .env("CARGO_TARGET_DIR", "out/bundle/rust")