mirror of
https://github.com/esp-rs/espup.git
synced 2025-09-28 05:10:44 +00:00
refactor: ♻️ Add uninstall method
This commit is contained in:
parent
8f2ce52020
commit
f25545e0f3
@ -10,7 +10,10 @@ use crate::{
|
||||
use async_trait::async_trait;
|
||||
use log::{info, warn};
|
||||
use miette::Result;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::{
|
||||
fs::remove_dir_all,
|
||||
path::{Path, PathBuf},
|
||||
};
|
||||
|
||||
const DEFAULT_LLVM_REPOSITORY: &str = "https://github.com/espressif/llvm-project/releases/download";
|
||||
const DEFAULT_LLVM_15_VERSION: &str = "esp-15.0.0-20221201";
|
||||
@ -78,6 +81,14 @@ impl Llvm {
|
||||
version,
|
||||
}
|
||||
}
|
||||
|
||||
/// Uninstall LLVM toolchain.
|
||||
pub fn uninstall(llvm_path: &Path) -> Result<(), Error> {
|
||||
info!("{} Deleting Xtensa LLVM", emoji::WRENCH);
|
||||
remove_dir_all(llvm_path)
|
||||
.map_err(|_| Error::FailedToRemoveDirectory(llvm_path.display().to_string()))?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
|
Loading…
x
Reference in New Issue
Block a user