Skip to content

Commit

Permalink
fix(cli_mode): don't prompt for db url if in cli_mode
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyMichaelTDM committed May 3, 2024
1 parent 500c06d commit 11d0b48
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions create-rust-app_cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,13 +255,18 @@ fn create_project(
}
};

println!("Press Enter will use default backend database url as config");
// get the backend database url
let backend_database_url: String = if cli_mode {
"postgres://postgres:postgres@localhost/database".to_string()
} else {
println!("Press Enter will use default backend database url as config");

let backend_database_url: String = Input::new()
.with_prompt(format!("{:?} url", backend_database))
.default("postgres://postgres:postgres@localhost/database".into())
.show_default(false)
.interact_text()?;
Input::new()
.with_prompt(format!("{:?} url", backend_database))
.default("postgres://postgres:postgres@localhost/database".into())
.show_default(false)
.interact_text()?
};

// get the backend framework
let backend_framework: BackendFramework = if let Some(framework) = framework {
Expand Down

0 comments on commit 11d0b48

Please sign in to comment.