Make init repository option compliant

This commit is contained in:
SkyfallWasTaken 2024-07-30 09:14:17 +01:00
parent f5206602d7
commit f79cdc95b8

View file

@ -74,10 +74,16 @@ pub async fn init() -> Result<()> {
.with_prompt("Test command")
.default("echo \"Error: no test specified\" && exit 1".into())
.interact_text()?;
let git_repository: String = Input::with_theme(&ColorfulTheme::default())
let mut git_repository: String = Input::with_theme(&ColorfulTheme::default())
.with_prompt("Git repository")
.default(git_repo_url.unwrap_or_default())
.interact_text()?;
if !git_repository.is_empty() {
// TODO: this doesn't handle SVN etc.
if !git_repository.ends_with(".git") {
git_repository.push_str(".git");
}
}
let author: String = Input::with_theme(&ColorfulTheme::default())
.with_prompt("Author name")
.allow_empty(true)