fixed the new folders not being created first
This commit is contained in:
@@ -8,6 +8,8 @@ use std::thread;
|
||||
use std::time::Duration;
|
||||
use std::str::FromStr;
|
||||
|
||||
use fs_extra::file;
|
||||
|
||||
use crate::Project;
|
||||
use crate::box_controls::make_box;
|
||||
|
||||
@@ -367,6 +369,22 @@ pub fn promote_project(projects: &mut Vec<Project>, config_path: &PathBuf, proje
|
||||
new_files_dir.push(&promoted_project.project_name);
|
||||
new_notes_dir.push(&promoted_project.customer);
|
||||
new_notes_dir.push(&promoted_project.project_name);
|
||||
let files_dir_creation = fs::create_dir_all(&new_files_dir);
|
||||
if files_dir_creation.is_err(){
|
||||
let error = files_dir_creation.err().unwrap();
|
||||
println!("error creating current files directory!");
|
||||
println!("{}", error);
|
||||
return;
|
||||
}
|
||||
files_dir_creation.unwrap();
|
||||
let notes_dir_creation = fs::create_dir_all(&new_notes_dir);
|
||||
if notes_dir_creation.is_err(){
|
||||
let error = notes_dir_creation.err().unwrap();
|
||||
println!("error creating current notes directory!");
|
||||
println!("{}", error);
|
||||
return;
|
||||
}
|
||||
notes_dir_creation.unwrap();
|
||||
let folder_move_success = process::Command::new("mv")
|
||||
.arg("-i")
|
||||
.arg(&project.files_folder)
|
||||
|
||||
Reference in New Issue
Block a user