25 lines
686 B
Rust
25 lines
686 B
Rust
use crate::{config::Config, util::CliStyle};
|
|
|
|
pub async fn run(config: Config) -> anyhow::Result<()> {
|
|
// These operations are so incredibly performance-critical that we absolutely
|
|
// must execute them in parallel!
|
|
let (res1, res2) = 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
|
|
}
|
|
);
|
|
|
|
res1?;
|
|
res2?;
|
|
|
|
Ok(())
|
|
}
|