File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -352,6 +352,11 @@ impl Serialize for Config {
352352 let book_config = Value :: try_from ( & self . book ) . expect ( "should always be serializable" ) ;
353353 table. insert ( "book" , book_config) ;
354354
355+ if self . build != BuildConfig :: default ( ) {
356+ let build_config = Value :: try_from ( & self . build ) . expect ( "should always be serializable" ) ;
357+ table. insert ( "build" , build_config) ;
358+ }
359+
355360 if self . rust != RustConfig :: default ( ) {
356361 let rust_config = Value :: try_from ( & self . rust ) . expect ( "should always be serializable" ) ;
357362 table. insert ( "rust" , rust_config) ;
Original file line number Diff line number Diff line change @@ -91,6 +91,12 @@ fn run_mdbook_init_with_custom_book_and_src_locations() {
9191 file
9292 ) ;
9393 }
94+
95+ let contents = fs:: read_to_string ( temp. path ( ) . join ( "book.toml" ) ) . unwrap ( ) ;
96+ assert_eq ! (
97+ contents,
98+ "[book]\n authors = []\n language = \" en\" \n multilingual = false\n src = \" in\" \n \n [build]\n build-dir = \" out\" \n create-missing = true\n use-default-preprocessors = true\n "
99+ ) ;
94100}
95101
96102#[ test]
You can’t perform that action at this time.
0 commit comments