mirror of
https://github.com/esp-rs/espup.git
synced 2025-09-28 13:20:41 +00:00
Merge pull request #114 from esp-rs/fix/llvm-uninstall
Improve LLVM uninstall
This commit is contained in:
commit
fa18737382
@ -302,9 +302,10 @@ async fn uninstall(args: UninstallOpts) -> Result<()> {
|
||||
|
||||
if let Some(llvm_path) = config.llvm_path {
|
||||
info!("{} Deleting Xtensa LLVM", emoji::WRENCH);
|
||||
let llvm_path = llvm_path.parent().unwrap();
|
||||
config.llvm_path = None;
|
||||
config.save()?;
|
||||
remove_dir_all(&llvm_path)
|
||||
remove_dir_all(llvm_path)
|
||||
.map_err(|_| Error::FailedToRemoveDirectory(llvm_path.display().to_string()))?;
|
||||
}
|
||||
|
||||
|
@ -131,11 +131,12 @@ impl XtensaRust {
|
||||
/// Removes the Xtensa Rust toolchain.
|
||||
pub fn uninstall(&self) -> Result<()> {
|
||||
info!("{} Uninstalling Xtensa Rust toolchain", emoji::WRENCH);
|
||||
remove_dir_all(&self.toolchain_destination)
|
||||
let toolchain_path = self.toolchain_destination.clone();
|
||||
#[cfg(windows)]
|
||||
let toolchain_path = toolchain_path.join("esp");
|
||||
remove_dir_all(&toolchain_path)
|
||||
.into_diagnostic()
|
||||
.map_err(|_| {
|
||||
Error::FailedToRemoveDirectory(self.toolchain_destination.display().to_string())
|
||||
})?;
|
||||
.map_err(|_| Error::FailedToRemoveDirectory(toolchain_path.display().to_string()))?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user