Skip to content

Commit a737f25

Browse files
authored
fix(tauri-build): delete existing sidecar file, closes #4134 (#4167)
1 parent b728131 commit a737f25

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

.changes/fix-sidecar-refresh.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri-build": patch
3+
---
4+
5+
Delete existing sidecar before copying new one.

core/tauri-build/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ fn copy_binaries<'a>(binaries: ResourcePaths<'a>, target_triple: &str, path: &Pa
4242
.to_string_lossy()
4343
.replace(&format!("-{}", target_triple), ""),
4444
);
45+
if dest.exists() {
46+
std::fs::remove_file(&dest).unwrap();
47+
}
4548
copy_file(&src, &dest)?;
4649
}
4750
Ok(())

0 commit comments

Comments
 (0)