Added a warning if people use the book.json config file

This commit is contained in:
Michael Bryan 2017-12-13 11:55:37 +11:00
parent d69bc9c7c3
commit 718d251c7f
No known key found for this signature in database
GPG Key ID: E9C602B0D9A998DC
1 changed files with 10 additions and 0 deletions

View File

@ -47,6 +47,16 @@ impl MDBook {
let book_root = book_root.into(); let book_root = book_root.into();
let config_location = book_root.join("book.toml"); let config_location = book_root.join("book.toml");
// the book.json file is no longer used, so we should emit a warning to
// let people know to migrate to book.toml
if book_root.join("book.json").exists() {
warn!("It appears you are still using book.json for configuration.");
warn!("This format is no longer used, so you should migrate to the");
warn!("book.toml format.");
warn!("Check the user guide for migration information:");
warn!("\thttps://rust-lang-nursery.github.io/mdBook/format/config.html");
}
let config = if config_location.exists() { let config = if config_location.exists() {
debug!("[*] Loading config from {}", config_location.display()); debug!("[*] Loading config from {}", config_location.display());
Config::from_disk(&config_location)? Config::from_disk(&config_location)?