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"); projects_path.push("projects");
let mut module_path = config_path.clone(); let mut module_path = config_path.clone();
module_path.push("modules"); 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(); let mut note_templates_path = config_path.clone();
note_templates_path.push("note_templates"); note_templates_path.push("note_templates");
create_dir_all(&module_path)?; 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( 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", "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 { if git_clone_status {
let mut options = CopyOptions::new(); let mut options = CopyOptions::new();
options.overwrite = true; options.overwrite = true;
options.copy_inside = true;
println!("copying note_templates..."); println!("copying note_templates...");
copy( copy(
"./tetanus/note_templates", "./tetanus/note_templates",
root_config_folder_path, root_config_folder_path.clone(),
&options, &options,
)?; )?;
println!("copying default-modules..."); println!("copying default-modules...");
for entry in read_dir("./tetanus/default-modules")? { copy(
let entry = entry?; "./tetanus/default-modules",
copy(entry.path(), default_module_path.clone(), &options)?; module_path.join("default"),
} &options,
)?;
println!("copying default victim templates..."); println!("copying default victim templates...");
for entry in read_dir("./tetanus/victim_templates")? { copy(
let entry = entry?; "./tetanus/victim_templates",
copy(entry.path(), victim_path.clone(), &options)?; root_config_folder_path.join("victim"),
} &options,
)?;
env::set_current_dir("../")?; env::set_current_dir("../")?;
remove_dir_all("./temp")?; remove_dir_all("./temp")?;
} }