]> git.lizzy.rs Git - rust.git/commitdiff
Bump mdbook dep to pick up new 'create missing' toggle feature.
authorCorey Farwell <coreyf@rwell.org>
Thu, 27 Apr 2017 02:04:04 +0000 (22:04 -0400)
committerCorey Farwell <coreyf@rwell.org>
Thu, 27 Apr 2017 14:28:23 +0000 (10:28 -0400)
This will avoid obscure Travis CI error messages:

* https://github.com/rust-lang/rust/pull/40290#issuecomment-294137045

Original mdbook issue:

* https://github.com/azerupi/mdBook/issues/253

mdbook PR:

* https://github.com/azerupi/mdBook/pull/254

src/Cargo.lock
src/tools/rustbook/Cargo.toml
src/tools/rustbook/src/main.rs

index f4c35719f363147986d0ed4a1c3d6b1b5f39f01e..a1e403c6f1389c92c132e46c54603ef07594248f 100644 (file)
@@ -269,7 +269,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "mdbook"
-version = "0.0.19"
+version = "0.0.21"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "clap 2.22.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -425,7 +425,7 @@ name = "rustbook"
 version = "0.1.0"
 dependencies = [
  "clap 2.22.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "mdbook 0.0.19 (registry+https://github.com/rust-lang/crates.io-index)",
+ "mdbook 0.0.21 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -1001,7 +1001,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 "checksum lazy_static 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "4732c563b9a21a406565c4747daa7b46742f082911ae4753f390dc9ec7ee1a97"
 "checksum libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)" = "88ee81885f9f04bff991e306fea7c1c60a5f0f9e409e99f6b40e3311a3363135"
 "checksum log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "5141eca02775a762cc6cd564d8d2c50f67c0ea3a372cbf1c51592b3e029e10ad"
-"checksum mdbook 0.0.19 (registry+https://github.com/rust-lang/crates.io-index)" = "2598843aeda0c5bb2e8e4d714564f1c3fc40f7844157e34563bf96ae3866b56e"
+"checksum mdbook 0.0.21 (registry+https://github.com/rust-lang/crates.io-index)" = "f1e2e9d848514dcfad4195788d0d42ae5153a477c191d75d5b84fab10f222fbd"
 "checksum memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1dbccc0e46f1ea47b9f17e6d67c5a96bd27030519c519c9c91327e31275a47b4"
 "checksum num-traits 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "e1cbfa3781f3fe73dc05321bed52a06d2d491eaa764c52335cf4399f046ece99"
 "checksum num_cpus 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "cee7e88156f3f9e19bdd598f8d6c9db7bf4078f99f8381f43a55b09648d1a6e3"
index e32093306722691b98590a9fd1ec90f4076e037e..2d5d163d4030533a56a0b848c93c8f510da87bfe 100644 (file)
@@ -8,5 +8,5 @@ license = "MIT/Apache-2.0"
 clap = "2.19.3"
 
 [dependencies.mdbook]
-version = "0.0.19"
+version = "0.0.21"
 default-features = false
index b77baed53267785bf30ba2144a866684443036c6..33326de9c1cc3f630ac7c8672d76e1b18a816e2f 100644 (file)
@@ -53,8 +53,7 @@ fn main() {
 
 // Build command implementation
 fn build(args: &ArgMatches) -> Result<(), Box<Error>> {
-    let book_dir = get_book_dir(args);
-    let book = MDBook::new(&book_dir).read_config();
+    let book = build_mdbook_struct(args);
 
     let mut book = match args.value_of("dest-dir") {
         Some(dest_dir) => book.set_dest(Path::new(dest_dir)),
@@ -67,14 +66,26 @@ fn build(args: &ArgMatches) -> Result<(), Box<Error>> {
 }
 
 fn test(args: &ArgMatches) -> Result<(), Box<Error>> {
-    let book_dir = get_book_dir(args);
-    let mut book = MDBook::new(&book_dir).read_config();
+    let mut book = build_mdbook_struct(args);
 
     try!(book.test());
 
     Ok(())
 }
 
+fn build_mdbook_struct(args: &ArgMatches) -> mdbook::MDBook {
+    let book_dir = get_book_dir(args);
+    let mut book = MDBook::new(&book_dir).read_config();
+
+    // By default mdbook will attempt to create non-existent files referenced
+    // from SUMMARY.md files. This is problematic on CI where we mount the
+    // source directory as readonly. To avoid any issues, we'll disabled
+    // mdbook's implicit file creation feature.
+    book.create_missing = false;
+
+    book
+}
+
 fn get_book_dir(args: &ArgMatches) -> PathBuf {
     if let Some(dir) = args.value_of("dir") {
         // Check if path is relative from current dir, or absolute...