mirror of
https://github.com/esp-rs/espup.git
synced 2025-10-02 15:14:56 +00:00
chore: 🎨 Exit the program if there is an existing esp toolchain installed
This commit is contained in:
parent
0afb642092
commit
e1bdee7045
@ -65,14 +65,16 @@ impl RustToolchain {
|
|||||||
|
|
||||||
/// Installs the Xtensa Rust toolchain.
|
/// Installs the Xtensa Rust toolchain.
|
||||||
pub fn install_xtensa(&self) -> Result<()> {
|
pub fn install_xtensa(&self) -> Result<()> {
|
||||||
if self.toolchain_destination.exists() {
|
#[cfg(unix)]
|
||||||
// TODO: This should end the installation.
|
let toolchain_path = self.toolchain_destination.clone();
|
||||||
warn!(
|
#[cfg(windows)]
|
||||||
|
let toolchain_path = self.toolchain_destination.clone().join("esp");
|
||||||
|
if toolchain_path.exists() {
|
||||||
|
bail!(
|
||||||
"{} Previous installation of Rust Toolchain exist in: {}.\n Please, remove the directory before new installation.",
|
"{} Previous installation of Rust Toolchain exist in: {}.\n Please, remove the directory before new installation.",
|
||||||
emoji::WARN,
|
emoji::WARN,
|
||||||
self.toolchain_destination.display()
|
self.toolchain_destination.display()
|
||||||
);
|
);
|
||||||
return Ok(());
|
|
||||||
}
|
}
|
||||||
info!("{} Installing Xtensa Rust toolchain", emoji::WRENCH);
|
info!("{} Installing Xtensa Rust toolchain", emoji::WRENCH);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user