Skip to content

Commit

Permalink
Fix #120 destination and source directories can now be constructed co…
Browse files Browse the repository at this point in the history
…rrectly even if multiple directories do not exist on the path
  • Loading branch information
azerupi committed Apr 25, 2016
1 parent 7f34512 commit 1b8af2b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/book/mdbook.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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");
Expand Down

0 comments on commit 1b8af2b

Please sign in to comment.