23 lines
741 B
Rust
23 lines
741 B
Rust
use crate::{config::Config, util::CliStyle};
|
|
|
|
pub async fn run(config: Config) -> miette::Result<()> {
|
|
// These operations are so incredibly performance-critical that we absolutely
|
|
// must execute them in parallel!
|
|
// we ignore the results on purpose, so nothing fails when the dirs dont exist.
|
|
let (_, _) = tokio::join!(
|
|
async {
|
|
println!(
|
|
"{}",
|
|
format!("Deleting {}", config.locations.temp_dir.to_string_lossy()).info(),
|
|
);
|
|
tokio::fs::remove_dir_all(config.locations.temp_dir).await
|
|
},
|
|
async {
|
|
println!("{}", "Deleting build".info(),);
|
|
tokio::fs::remove_dir_all("build").await
|
|
}
|
|
);
|
|
|
|
Ok(())
|
|
}
|