From b80182a348578fbe54cb8cd255b5087d75a44a7c Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Thu, 13 Jun 2024 06:43:41 +0200 Subject: fix(new::section): Avoid overriding already existing section file --- src/new/section.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/new') diff --git a/src/new/section.rs b/src/new/section.rs index 86d347c..bfa2b2c 100644 --- a/src/new/section.rs +++ b/src/new/section.rs @@ -39,13 +39,13 @@ pub fn generate_new_section( ), ); - let new_section_file = GeneratedFile::new( + file_tree.add_file(GeneratedFile::new_clobber( chapter_root .join("sections") .join(format!("{}.tex", MangledName::new(&name))), new_section_text, - ); - file_tree.add_file(new_section_file); + false, + )); let chapter_file_path = chapter_root.join("chapter.tex"); let mut chapter_file_text = fs::read_to_string(&chapter_file_path).with_context(|| { -- cgit 1.4.1