From f9638b6315668ced871f242224f001f474262f85 Mon Sep 17 00:00:00 2001 From: Fabian-Lars Date: Thu, 18 Apr 2024 05:31:07 +0200 Subject: [PATCH] fix(cli): append extension to app binary manually on rename (#9491) fixes #9488 fixes #8848 --- .changes/cli-rename-app.md | 6 ++++++ tooling/cli/src/interface/rust/desktop.rs | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 .changes/cli-rename-app.md diff --git a/.changes/cli-rename-app.md b/.changes/cli-rename-app.md new file mode 100644 index 000000000000..622151aa0b31 --- /dev/null +++ b/.changes/cli-rename-app.md @@ -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. diff --git a/tooling/cli/src/interface/rust/desktop.rs b/tooling/cli/src/interface/rust/desktop.rs index 5ec4f84e306d..b97adb0d0d53 100644 --- a/tooling/cli/src/interface/rust/desktop.rs +++ b/tooling/cli/src/interface/rust/desktop.rs @@ -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!(