Skip to content

Commit

Permalink
fix(cli): append extension to app binary manually on rename (#9491)
Browse files Browse the repository at this point in the history
fixes #9488
fixes #8848
  • Loading branch information
FabianLars committed Apr 18, 2024
1 parent aeddc40 commit f9638b6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changes/cli-rename-app.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'tauri-cli': 'patch:bug'
'@tauri-apps/cli': 'patch:bug'
---

Fixed an issue that caused the CLI to rename app binaries incorrectly if the product name contained a `.` which resulted in the bundling step to fail.
5 changes: 3 additions & 2 deletions tooling/cli/src/interface/rust/desktop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,11 +357,12 @@ fn rename_app(
product_name.into()
};

let binary_extension = if target_os == "windows" { ".exe" } else { "" };

let product_path = bin_path
.parent()
.unwrap()
.join(product_name)
.with_extension(bin_path.extension().unwrap_or_default());
.join(format!("{product_name}{binary_extension}"));

rename(bin_path, &product_path).with_context(|| {
format!(
Expand Down

0 comments on commit f9638b6

Please sign in to comment.