add cargo
This commit is contained in:
21
src/commands/clean.rs
Normal file
21
src/commands/clean.rs
Normal file
@ -0,0 +1,21 @@
|
||||
use anyhow::Result;
|
||||
use colored::Colorize;
|
||||
use std::fs;
|
||||
use std::path::Path;
|
||||
|
||||
pub async fn execute() -> Result<()> {
|
||||
println!("{}", "Cleaning build artifacts...".yellow());
|
||||
|
||||
let public_dir = Path::new("public");
|
||||
|
||||
if public_dir.exists() {
|
||||
fs::remove_dir_all(public_dir)?;
|
||||
println!("{} public directory", "Removed".cyan());
|
||||
} else {
|
||||
println!("{}", "No build artifacts to clean");
|
||||
}
|
||||
|
||||
println!("{}", "Clean completed!".green().bold());
|
||||
|
||||
Ok(())
|
||||
}
|
Reference in New Issue
Block a user