diff --git a/src/main.rs b/src/main.rs index 931cc6d..e382dd4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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()))?; } diff --git a/src/toolchain/rust.rs b/src/toolchain/rust.rs index 844ab32..94a8165 100644 --- a/src/toolchain/rust.rs +++ b/src/toolchain/rust.rs @@ -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(()) } }