mirror of
https://github.com/rust-lang/mdBook
synced 2024-12-14 06:42:35 +00:00
Added a quick fix so if the config isn't found we use a default
This commit is contained in:
parent
f22835f7bc
commit
8ee795045a
1 changed files with 7 additions and 2 deletions
|
@ -299,8 +299,13 @@ impl MDBook {
|
|||
|
||||
pub fn read_config(mut self) -> Result<Self> {
|
||||
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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue