Skip to content

Commit

Permalink
Rename var for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
autarch committed Jul 21, 2024
1 parent 2b35b64 commit 3ea6d5a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,18 +235,18 @@ fn self_upgrade_ubi(ubi_exe_path: &Path) -> Result<(Ubi<'_>, Option<impl FnOnce(
.build()?;

let post_run = if cfg!(target_os = "windows") {
let mut new_exe = ubi_exe_path.to_path_buf();
new_exe.set_file_name("ubi-old.exe");
let mut old_exe = ubi_exe_path.to_path_buf();
old_exe.set_file_name("ubi-old.exe");
debug!(
"renaming {} to {}",
ubi_exe_path.display(),
new_exe.display()
old_exe.display()
);
std::fs::rename(ubi_exe_path, &new_exe)?;
std::fs::rename(ubi_exe_path, &old_exe)?;
Some(move || {
println!(
"The self-upgrade operation left an old binary behind that must be deleted manually: {}",
new_exe.display(),
old_exe.display(),
);
})
} else {
Expand Down

0 comments on commit 3ea6d5a

Please sign in to comment.