Fix upgrade command failing with "No such file or directory"

The release tarball nests the binary in a subdirectory
(fabro-{triple}/fabro), but the upgrade code expected it at the
tarball root. Use the correct nested path matching the tarball structure.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Bryan Helmkamp 2026-03-19 15:58:50 -04:00
parent bf44713723
commit 8a3ce34209
No known key found for this signature in database

View file

@ -330,7 +330,7 @@ pub async fn run_upgrade(args: UpgradeArgs) -> Result<()> {
}
// Atomic binary replacement
let extracted_binary = tmp_dir.path().join("fabro");
let extracted_binary = tmp_dir.path().join(format!("fabro-{triple}")).join("fabro");
let backup = exe_dir.join(".fabro-upgrade-backup");
fs::rename(&current_exe, &backup).context("failed to move current binary to backup")?;
if let Err(e) = fs::rename(&extracted_binary, &current_exe) {