Skip to content

Commit

Permalink
feat: trim inputs (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
colinlienard authored Jul 16, 2024
1 parent 4fcc739 commit 9e0addb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,14 @@ impl Config {
let name = Text::new("Name:")
.with_validators(&[Box::new(get_not_empty_validator())])
.prompt()?;
let name = name.trim();

let commit_name = match scope {
Some(scope) => {
if scope.is_empty() {
format!("{}: {}", _type, name)
} else {
format!("{}({}): {}", _type, scope, name)
format!("{}({}): {}", _type, scope.trim(), name)
}
}
None => format!("{}: {}", _type, name),
Expand Down

0 comments on commit 9e0addb

Please sign in to comment.