From 1b8af2bf57acfb180ea460f59a0c2f553757841b Mon Sep 17 00:00:00 2001 From: Mathieu David Date: Mon, 25 Apr 2016 15:58:44 +0200 Subject: [PATCH] Fix #120 destination and source directories can now be constructed correctly even if multiple directories do not exist on the path --- src/book/mdbook.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/book/mdbook.rs b/src/book/mdbook.rs index 05fcb7cb..53e88514 100644 --- a/src/book/mdbook.rs +++ b/src/book/mdbook.rs @@ -118,12 +118,12 @@ impl MDBook { if !self.dest.exists() { debug!("[*]: {:?} does not exist, trying to create directory", self.dest); - try!(fs::create_dir(&self.dest)); + try!(fs::create_dir_all(&self.dest)); } if !self.src.exists() { debug!("[*]: {:?} does not exist, trying to create directory", self.src); - try!(fs::create_dir(&self.src)); + try!(fs::create_dir_all(&self.src)); } let summary = self.src.join("SUMMARY.md"); @@ -132,7 +132,7 @@ impl MDBook { // Summary does not exist, create it - debug!("[*]: {:?} does not exist, trying to create SUMMARY.md", src.join("SUMMARY.md")); + debug!("[*]: {:?} does not exist, trying to create SUMMARY.md", self.src.join("SUMMARY.md")); let mut f = try!(File::create(&self.src.join("SUMMARY.md"))); debug!("[*]: Writing to SUMMARY.md");