use std::path::Path;
use anyhow::Result;
use crate::subprocess_utils::check_call;
pub fn clean_hard(project: &Path) -> Result<bool> {
check_call(project, "git", &["clean", "-ffxd"])?;
Ok(true)
}
pub fn clean_soft(project: &Path) -> Result<bool> {
check_call(project, "git", &["clean", "-fd"])?;
Ok(true)
}
pub fn clean_make(project: &Path) -> Result<bool> {
check_call(project, "make", &["clean"])?;
Ok(true)
}
pub fn clean_git(project: &Path) -> Result<bool> {
check_call(project, "git", &["checkout", "."])?;
Ok(true)
}
pub fn clean_cargo(project: &Path) -> Result<bool> {
if !project.join("Cargo.toml").exists() {
return Ok(false);
}
check_call(project, "cargo", &["clean"])?;
Ok(true)
}