Skip to content

Commit

Permalink
fix init --title option failure when git user is not configured
Browse files Browse the repository at this point in the history
  • Loading branch information
eureka-cpu authored and ehuss committed Nov 18, 2024
1 parent 0c580c3 commit 8f024da
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/cmd/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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...");

Expand Down
2 changes: 1 addition & 1 deletion tests/cli/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}

0 comments on commit 8f024da

Please sign in to comment.