From e8b557bb4e57e0777085dbc040e6d88c51738f07 Mon Sep 17 00:00:00 2001 From: pyro57000 Date: Thu, 9 Jan 2025 14:08:46 -0600 Subject: [PATCH] edited install function to actually work right the bell file was trying to be written too soon, this has been fixed. --- pentest_tool/src/install.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pentest_tool/src/install.rs b/pentest_tool/src/install.rs index 492a88c..4b1ca40 100644 --- a/pentest_tool/src/install.rs +++ b/pentest_tool/src/install.rs @@ -122,6 +122,9 @@ pub fn install(config_path: &PathBuf){ config_folder_path.pop(); let mut projects_conf_path = config_folder_path.clone(); let mut bell_file_path = config_folder_path.clone(); + let del_on_fail = config_folder_path.clone(); + projects_conf_path.push("projects.conf"); + fs::create_dir_all(&config_folder_path).expect("error creating config dir"); bell_file_path.push("bell.mp3"); let bell_sound_url = "https://github.com/Pyro57000/pentest_tool/raw/refs/heads/main/resources/bell.mp3"; let response = get(bell_sound_url).unwrap(); @@ -129,9 +132,6 @@ pub fn install(config_path: &PathBuf){ let mut bell_file = File::create(bell_file_path).unwrap(); copy(&mut response.take(response_length), &mut bell_file).unwrap(); println!("bell notification tone sucessfully downloaded!"); - let del_on_fail = config_folder_path.clone(); - projects_conf_path.push("projects.conf"); - fs::create_dir_all(&config_folder_path).expect("error creating config dir"); let mut config_file = fs::File::create(config_path).expect("error creating file"); let mut projects_conf_file = fs::File::create(projects_conf_path).expect("error creating projects config file"); projects_conf_file.write_all(b"customer:name:notes:files:active:box_name\n").expect("error writing default project info");