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