updated the install function to properly copy files and such.

This commit is contained in:
2026-08-14 17:03:07 -05:00
parent 9dd44796d6
commit 06a7c1d053
+12 -17
View File
@@ -37,17 +37,9 @@ pub fn client_install() -> Result<(), Box<dyn Error>> {
projects_path.push("projects");
let mut module_path = config_path.clone();
module_path.push("modules");
let default_module_path = module_path.join("default");
create_dir_all(&default_module_path)?;
let mut note_templates_path = config_path.clone();
note_templates_path.push("note_templates");
create_dir_all(&module_path)?;
module_path.push("custom");
create_dir_all(&module_path)?;
module_path.pop();
let mut victim_path = config_path.clone();
victim_path.push("victim");
create_dir_all(&victim_path)?;
let current_files_path = PathBuf::from(get_user_input(
"enter the path to store currently in progress project files (not notes), or none if you want to be propted everytime",
)?);
@@ -121,22 +113,25 @@ pub fn client_install() -> Result<(), Box<dyn Error>> {
if git_clone_status {
let mut options = CopyOptions::new();
options.overwrite = true;
options.copy_inside = true;
println!("copying note_templates...");
copy(
"./tetanus/note_templates",
root_config_folder_path,
root_config_folder_path.clone(),
&options,
)?;
println!("copying default-modules...");
for entry in read_dir("./tetanus/default-modules")? {
let entry = entry?;
copy(entry.path(), default_module_path.clone(), &options)?;
}
copy(
"./tetanus/default-modules",
module_path.join("default"),
&options,
)?;
println!("copying default victim templates...");
for entry in read_dir("./tetanus/victim_templates")? {
let entry = entry?;
copy(entry.path(), victim_path.clone(), &options)?;
}
copy(
"./tetanus/victim_templates",
root_config_folder_path.join("victim"),
&options,
)?;
env::set_current_dir("../")?;
remove_dir_all("./temp")?;
}