Skip to content

Commit 5437188

Browse files
committed
update mdbook to 0.1.2
and improve printing of errors
1 parent b320829 commit 5437188

File tree

3 files changed

+53
-10
lines changed

3 files changed

+53
-10
lines changed

src/Cargo.lock

+45-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/tools/rustbook/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ license = "MIT/Apache-2.0"
88
clap = "2.25.0"
99

1010
[dependencies.mdbook]
11-
version = "0.0.28"
11+
version = "0.1.2"
1212
default-features = false

src/tools/rustbook/src/main.rs

+7-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ extern crate mdbook;
1313
extern crate clap;
1414

1515
use std::env;
16-
use std::io::{self, Write};
1716
use std::path::{Path, PathBuf};
1817

1918
use clap::{App, ArgMatches, SubCommand, AppSettings};
@@ -45,14 +44,19 @@ fn main() {
4544
};
4645

4746
if let Err(e) = res {
48-
writeln!(&mut io::stderr(), "An error occured:\n{}", e).ok();
47+
eprintln!("Error: {}", e);
48+
49+
for cause in e.iter().skip(1) {
50+
eprintln!("\tCaused By: {}", cause);
51+
}
52+
4953
::std::process::exit(101);
5054
}
5155
}
5256
// Build command implementation
5357
pub fn build(args: &ArgMatches) -> Result<()> {
5458
let book_dir = get_book_dir(args);
55-
let mut book = MDBook::new(&book_dir).read_config()?;
59+
let mut book = MDBook::load(&book_dir)?;
5660

5761
// Set this to allow us to catch bugs in advance.
5862
book.config.build.create_missing = false;

0 commit comments

Comments
 (0)