From 06a7c1d05386453ee8e7096bbd16764983ebca0c Mon Sep 17 00:00:00 2001 From: pyro Date: Fri, 14 Aug 2026 17:03:07 -0500 Subject: [PATCH] updated the install function to properly copy files and such. --- src/install.rs | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/src/install.rs b/src/install.rs index 7f858f9..e32f1ca 100644 --- a/src/install.rs +++ b/src/install.rs @@ -37,17 +37,9 @@ pub fn client_install() -> Result<(), Box> { 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> { 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")?; }