mirror of
https://github.com/esp-rs/espup.git
synced 2025-10-02 07:10:36 +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 async_trait::async_trait;
|
||||||
use log::{info, warn};
|
use log::{info, warn};
|
||||||
use miette::Result;
|
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_REPOSITORY: &str = "https://github.com/espressif/llvm-project/releases/download";
|
||||||
const DEFAULT_LLVM_15_VERSION: &str = "esp-15.0.0-20221201";
|
const DEFAULT_LLVM_15_VERSION: &str = "esp-15.0.0-20221201";
|
||||||
@ -78,6 +81,14 @@ impl Llvm {
|
|||||||
version,
|
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]
|
#[async_trait]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user