File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " cli.rs " : patch
3+ " cli.js " : patch
4+ ---
5+
6+ Change the updater signature metadata to include the file name instead of its full path.
Original file line number Diff line number Diff line change @@ -109,6 +109,7 @@ pub fn sign_file<P>(
109109where
110110 P : AsRef < Path > ,
111111{
112+ let bin_path = bin_path. as_ref ( ) ;
112113 let decoded_secret = decode_key ( private_key) ?;
113114 let sk_box = SecretKeyBox :: from_string ( & decoded_secret)
114115 . with_context ( || "failed to load updater private key" ) ?;
@@ -117,15 +118,16 @@ where
117118 . with_context ( || "incorrect updater private key password" ) ?;
118119
119120 // We need to append .sig at the end it's where the signature will be stored
120- let signature_path_string = format ! ( "{}.sig" , bin_path. as_ref( ) . display( ) ) ;
121- let signature_path = Path :: new ( & signature_path_string) ;
121+ let mut extension = bin_path. extension ( ) . unwrap ( ) . to_os_string ( ) ;
122+ extension. push ( ".sig" ) ;
123+ let signature_path = bin_path. with_extension ( extension) ;
122124
123- let mut signature_box_writer = create_file ( signature_path) ?;
125+ let mut signature_box_writer = create_file ( & signature_path) ?;
124126
125127 let trusted_comment = format ! (
126128 "timestamp:{}\t file:{}" ,
127129 unix_timestamp( ) ,
128- bin_path. as_ref ( ) . display ( )
130+ bin_path. file_name ( ) . unwrap ( ) . to_string_lossy ( )
129131 ) ;
130132
131133 let data_reader = open_data_file ( bin_path) ?;
You can’t perform that action at this time.
0 commit comments