Skip to content

Commit 45736bb

Browse files
committed
Do not prompt the user if the team URL was predetermined
1 parent 2a8bfaf commit 45736bb

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

crates/generate_blog/src/main.rs

+8-7
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,15 @@ fn main() -> Result<(), Box<dyn Error>> {
9494

9595
let team = team_prompt.prompt()?;
9696

97-
let prefilled_url = team_data
97+
let url = if let Some(url) = team_data
9898
.as_ref()
99-
.and_then(|teams| find_team_url(teams, &team))
100-
.unwrap_or_else(|| BASE_TEAM_WEBSITE_URL.to_string());
101-
102-
let url = Text::new("At what URL can people find the team?")
103-
.with_initial_value(&prefilled_url)
104-
.prompt()?;
99+
.and_then(|teams| find_team_url(teams, &team)) {
100+
url
101+
} else {
102+
Text::new("At what URL can people find the team?")
103+
.with_initial_value(&BASE_TEAM_WEBSITE_URL)
104+
.prompt()?
105+
};
105106
(Some(team), Some(url))
106107
};
107108

0 commit comments

Comments
 (0)