From c6be1fc98d5b44c4ee7b26e741221d6b387b8ff2 Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Date: Mon, 30 Oct 2023 13:33:23 +0000 Subject: [PATCH] feat: Merge main --- src/toolchain/llvm.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/toolchain/llvm.rs b/src/toolchain/llvm.rs index 54b8d1ef..c6ff0dc8 100644 --- a/src/toolchain/llvm.rs +++ b/src/toolchain/llvm.rs @@ -13,8 +13,12 @@ use directories::BaseDirs; use log::{info, warn}; use miette::Result; use regex::Regex; -use std::env; -use std::path::{Path, PathBuf}; +#[cfg(unix)] +use std::os::unix::fs::symlink; +use std::{ + fs::create_dir_all, + path::{Path, PathBuf}, +}; use tokio::fs::remove_dir_all; const DEFAULT_LLVM_REPOSITORY: &str = "https://github.com/espressif/llvm-project/releases/download"; @@ -153,6 +157,7 @@ impl Llvm { if espup_dir.exists() { remove_dir_all(espup_dir.display().to_string()) + .await .map_err(|_| Error::RemoveDirectory(espup_dir.display().to_string()))?; } } @@ -215,6 +220,7 @@ impl Installable for Llvm { let llvm_symlink_path = espup_dir.join("esp-clang"); if llvm_symlink_path.exists() { remove_dir_all(&llvm_symlink_path) + .await .map_err(|_| Error::RemoveDirectory(llvm_symlink_path.display().to_string()))?; } info!(