Fixed cargo uninstall behavior in Windows

This commit is contained in:
Lin Yihai 2023-11-28 17:35:20 +08:00
parent 9b13310ca5
commit 09be0eef54

View file

@ -146,11 +146,13 @@ fn uninstall_pkgid(
}
tracker.remove(pkgid, &bins);
}
tracker.save()?;
for bin in to_remove {
config.shell().status("Removing", bin.display())?;
paths::remove_file(bin)?;
}
// Only Save the tracker when remove Bin successfully.
tracker.save()?;
Ok(())
}