diff --git a/src/cmd/init.rs b/src/cmd/init.rs index 2c6415b6..f15fb968 100644 --- a/src/cmd/init.rs +++ b/src/cmd/init.rs @@ -74,9 +74,9 @@ pub fn execute(args: &ArgMatches) -> Result<()> { if let Some(author) = get_author_name() { debug!("Obtained user name from gitconfig: {:?}", author); config.book.authors.push(author); - builder.with_config(config); } + builder.with_config(config); builder.build()?; println!("\nAll done, no errors..."); diff --git a/tests/cli/init.rs b/tests/cli/init.rs index 6007673a..51c2bfa3 100644 --- a/tests/cli/init.rs +++ b/tests/cli/init.rs @@ -43,5 +43,5 @@ fn no_git_config_with_title() { .stdout(predicates::str::contains("\nAll done, no errors...\n")); let config = Config::from_disk(temp.path().join("book.toml")).unwrap(); - assert_eq!(config.book.title, None); + assert_eq!(config.book.title.as_deref(), Some("Example title")); }