|
@@ -133,12 +133,21 @@ impl Build {
|
|
if let Some(product_name) = config_.package.product_name.clone() {
|
|
if let Some(product_name) = config_.package.product_name.clone() {
|
|
let bin_name = app_settings.cargo_package_settings().name.clone();
|
|
let bin_name = app_settings.cargo_package_settings().name.clone();
|
|
#[cfg(windows)]
|
|
#[cfg(windows)]
|
|
- rename(
|
|
|
|
- out_dir.join(format!("{}.exe", bin_name)),
|
|
|
|
- out_dir.join(format!("{}.exe", product_name)),
|
|
|
|
- )?;
|
|
|
|
|
|
+ let (bin_path, product_path) = {
|
|
|
|
+ (
|
|
|
|
+ out_dir.join(format!("{}.exe", bin_name)),
|
|
|
|
+ out_dir.join(format!("{}.exe", product_name)),
|
|
|
|
+ )
|
|
|
|
+ };
|
|
#[cfg(not(windows))]
|
|
#[cfg(not(windows))]
|
|
- rename(out_dir.join(bin_name), out_dir.join(product_name))?;
|
|
|
|
|
|
+ let (bin_path, product_path) = { (out_dir.join(bin_name), out_dir.join(product_name)) };
|
|
|
|
+ rename(&bin_path, &product_path).with_context(|| {
|
|
|
|
+ format!(
|
|
|
|
+ "failed to rename `{}` to `{}`",
|
|
|
|
+ bin_path.display(),
|
|
|
|
+ product_path.display(),
|
|
|
|
+ )
|
|
|
|
+ })?;
|
|
}
|
|
}
|
|
|
|
|
|
if config_.tauri.bundle.active {
|
|
if config_.tauri.bundle.active {
|