diff --git a/cli/src/forge.rs b/cli/src/forge.rs index f0e403fdbebd..619e61f99eac 100644 --- a/cli/src/forge.rs +++ b/cli/src/forge.rs @@ -235,7 +235,8 @@ fn main() -> eyre::Result<()> { } Subcommands::Clean { root } => { let root = root.unwrap_or_else(|| std::env::current_dir().unwrap()); - utils::cleanup(root)?; + let project = Project::builder().root(root).build()?; + project.cleanup()?; } } diff --git a/cli/src/utils.rs b/cli/src/utils.rs index 8eb2db042b63..fe2342ff89df 100644 --- a/cli/src/utils.rs +++ b/cli/src/utils.rs @@ -68,9 +68,3 @@ pub fn find_dapp_json_contract(path: &str, name: &str) -> eyre::Result Ok(serde_json::from_value(contract)?) } - -pub fn cleanup(root: PathBuf) -> eyre::Result<()> { - std::fs::remove_dir_all(root.join("cache"))?; - std::fs::remove_dir_all(root.join("out"))?; - Ok(()) -}