Added a quick fix so if the config isn't found we use a default

This commit is contained in:
Michael Bryan 2017-12-09 20:36:23 +11:00
parent f22835f7bc
commit 8ee795045a
No known key found for this signature in database
GPG Key ID: E9C602B0D9A998DC
1 changed files with 7 additions and 2 deletions

View File

@ -299,8 +299,13 @@ impl MDBook {
pub fn read_config(mut self) -> Result<Self> { pub fn read_config(mut self) -> Result<Self> {
let config_path = self.root.join("book.toml"); let config_path = self.root.join("book.toml");
if config_path.exists() {
debug!("[*] Loading the config from {}", config_path.display()); debug!("[*] Loading the config from {}", config_path.display());
self.config = Config::from_disk(&config_path)?; self.config = Config::from_disk(&config_path)?;
} else {
self.config = Config::default();
}
Ok(self) Ok(self)
} }