refactor: better collisiom detection

This commit is contained in:
zhom
2025-08-10 03:39:26 +04:00
parent 690254cada
commit 17483e50b3
3 changed files with 66 additions and 25 deletions
+8
View File
@@ -1329,6 +1329,14 @@ fn resolve_output_path(
let base_name = custom_name.unwrap_or(app_name);
let mut output_path = PathBuf::from(format!("{base_name}{ext}"));
// On Windows, also consider collision with a directory named without extension
if Platform::current().is_windows() {
let dir_collision = PathBuf::from(base_name);
if dir_collision.exists() && dir_collision.is_dir() {
output_path = PathBuf::from(format!("{base_name}-bundle{ext}"));
}
}
let mut counter = 1;
while output_path.exists() {
if output_path.is_dir() {