Skip to content

Commit 1b0e335

Browse files
wasuajeWuelfhis AsuajeLegend-Master
authored
Fix: Updater signer failed signing file without extension (#14713)
* fixing bug where updater signer failed signing file withou extension * removing unnecessary unwrap() * Adding change file. Removing commnent. Adding TODO. * Apply suggestions from code review --------- Co-authored-by: Wuelfhis Asuaje <wasuaje@shorecg.com> Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>
1 parent 84b04c4 commit 1b0e335

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
tauri-cli: patch:bug
3+
"@tauri-apps/cli": patch:bug
4+
---
5+
6+
`tauri signer sign` doesn't work for files without an extension

crates/tauri-cli/src/helpers/updater_signature.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,14 @@ where
120120
{
121121
let bin_path = bin_path.as_ref();
122122
// We need to append .sig at the end it's where the signature will be stored
123-
let mut extension = bin_path.extension().unwrap().to_os_string();
124-
extension.push(".sig");
125-
let signature_path = bin_path.with_extension(extension);
123+
// TODO: use with_added_extension when we bump MSRV to > 1.91'
124+
let signature_path = if let Some(ext) = bin_path.extension() {
125+
let mut extension = ext.to_os_string();
126+
extension.push(".sig");
127+
bin_path.with_extension(extension)
128+
} else {
129+
bin_path.with_extension("sig")
130+
};
126131

127132
let trusted_comment = format!(
128133
"timestamp:{}\tfile:{}",

0 commit comments

Comments
 (0)