File tree Expand file tree Collapse file tree 2 files changed +19
-5
lines changed
Expand file tree Collapse file tree 2 files changed +19
-5
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " cli.rs " : patch
3+ ---
4+
5+ Improve error message when the product name is invalid.
Original file line number Diff line number Diff line change @@ -133,12 +133,21 @@ impl Build {
133133 if let Some ( product_name) = config_. package . product_name . clone ( ) {
134134 let bin_name = app_settings. cargo_package_settings ( ) . name . clone ( ) ;
135135 #[ cfg( windows) ]
136- rename (
137- out_dir. join ( format ! ( "{}.exe" , bin_name) ) ,
138- out_dir. join ( format ! ( "{}.exe" , product_name) ) ,
139- ) ?;
136+ let ( bin_path, product_path) = {
137+ (
138+ out_dir. join ( format ! ( "{}.exe" , bin_name) ) ,
139+ out_dir. join ( format ! ( "{}.exe" , product_name) ) ,
140+ )
141+ } ;
140142 #[ cfg( not( windows) ) ]
141- rename ( out_dir. join ( bin_name) , out_dir. join ( product_name) ) ?;
143+ let ( bin_path, product_path) = { ( out_dir. join ( bin_name) , out_dir. join ( product_name) ) } ;
144+ rename ( & bin_path, & product_path) . with_context ( || {
145+ format ! (
146+ "failed to rename `{}` to `{}`" ,
147+ bin_path. display( ) ,
148+ product_path. display( ) ,
149+ )
150+ } ) ?;
142151 }
143152
144153 if config_. tauri . bundle . active {
You can’t perform that action at this time.
0 commit comments