Added a quick fix so if the config isn't found we use a default
This commit is contained in:
parent
f22835f7bc
commit
8ee795045a
|
@ -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");
|
||||||
debug!("[*] Loading the config from {}", config_path.display());
|
|
||||||
self.config = Config::from_disk(&config_path)?;
|
if config_path.exists() {
|
||||||
|
debug!("[*] Loading the config from {}", config_path.display());
|
||||||
|
self.config = Config::from_disk(&config_path)?;
|
||||||
|
} else {
|
||||||
|
self.config = Config::default();
|
||||||
|
}
|
||||||
|
|
||||||
Ok(self)
|
Ok(self)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue