From 1c3979ca16df0c94be65c967ba6a82410e42db24 Mon Sep 17 00:00:00 2001 From: Bastian Gruber Date: Sat, 6 Apr 2019 11:57:02 +0200 Subject: [PATCH] Add book.toml to tools/unstable, add copy_book_toml to scipt --- .../unstable-book-gen/src}/book.toml | 1 + src/tools/unstable-book-gen/src/main.rs | 7 +++++++ 2 files changed, 8 insertions(+) rename src/{doc/unstable-book => tools/unstable-book-gen/src}/book.toml (57%) diff --git a/src/doc/unstable-book/book.toml b/src/tools/unstable-book-gen/src/book.toml similarity index 57% rename from src/doc/unstable-book/book.toml rename to src/tools/unstable-book-gen/src/book.toml index 5534340f0db..5b2e19bd7aa 100644 --- a/src/doc/unstable-book/book.toml +++ b/src/tools/unstable-book-gen/src/book.toml @@ -1,2 +1,3 @@ [book] title = "The Rust Unstable Book" +author = "The Rust Community" diff --git a/src/tools/unstable-book-gen/src/main.rs b/src/tools/unstable-book-gen/src/main.rs index 427014ce7fe..ec8654adb41 100644 --- a/src/tools/unstable-book-gen/src/main.rs +++ b/src/tools/unstable-book-gen/src/main.rs @@ -116,6 +116,11 @@ fn copy_recursive(path: &Path, to: &Path) { } } +fn copy_book_toml(path: &Path) { + let mut file = t!(File::create(&path.join("book.toml"))); + t!(file.write_fmt(format_args!(include_str!("book.toml")); +} + fn main() { let src_path_str = env::args_os().skip(1).next().expect("source path required"); let dest_path_str = env::args_os().skip(2).next().expect("destination path required"); @@ -141,4 +146,6 @@ fn main() { copy_recursive(&doc_src_path, &dest_path); generate_summary(&dest_path, &lang_features, &lib_features); + + copy_book_toml(&dest_path); }