use std::{fs, path::Path};
use crate::{cli::CleanArgs, embargo_toml::{ConfigFile, EmbargoFile}, error::EmbargoResult};
#[allow(unreachable_code)]
pub fn clean_project(args: &CleanArgs, embargo_toml: &EmbargoFile, embargo_toml_path: &Path) -> EmbargoResult {
let mut clean_path = embargo_toml_path.to_path_buf();
clean_path.push(embargo_toml.build_path());
let message = if !args.objects && !args.debug && !args.release {
fs::remove_dir_all(&clean_path)?;
String::from("Successfully cleaned build directory.")
} else {
unimplemented!();
let mut message = String::new();
if args.debug {
clean_path.push(embargo_toml.target_path_debug());
if args.objects {
clean_path.push(embargo_toml.object_path());
} else {
}
}
if args.release {
clean_path.push(embargo_toml.target_path_release());
}
message
};
Ok(Some(message))
}