diff options
Diffstat (limited to 'src/new/project.rs')
-rw-r--r-- | src/new/project.rs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/new/project.rs b/src/new/project.rs index e04d138..56edead 100644 --- a/src/new/project.rs +++ b/src/new/project.rs @@ -6,17 +6,15 @@ use std::{ process::Command, }; - use convert_case::{Case, Casing}; use crate::data::Data; -use super::{TITLE_FILE, CHAPTER, MAIN_FILE}; +use super::{CHAPTER, MAIN_FILE, TITLE_FILE}; const NEEDED_DIRECTORYS: &'static [&'static str] = &["build", "content", "headers", "references", "resources"]; - pub fn generate_new_project( name: String, first_chapter: String, @@ -41,7 +39,12 @@ pub fn generate_new_project( let mut title_file = File::create("title.tex").unwrap(); title_file.write_all(TITLE_FILE.as_bytes()).unwrap(); - env::set_current_dir(project_root.join("content").join(&first_chapter.to_case(Case::Snake))).unwrap(); + env::set_current_dir( + project_root + .join("content") + .join(&first_chapter.to_case(Case::Snake)), + ) + .unwrap(); fs::create_dir("sections").unwrap(); let mut chapter_file = File::create("chapter_01.tex").unwrap(); chapter_file @@ -102,9 +105,7 @@ pub fn generate_new_project( .expect("failed to execute process"); let mut lpm_file = File::create(".gitignore").unwrap(); - lpm_file - .write_all(b"/build") - .unwrap(); + lpm_file.write_all(b"/build").unwrap(); Ok(()) } |