Skip to content

Commit

Permalink
fix(cli_mode): don't prompt for db url if in cli_mode (#370)
Browse files Browse the repository at this point in the history
* fix(cli_mode): don't prompt for db url if in cli_mode
  • Loading branch information
AnthonyMichaelTDM authored May 4, 2024
1 parent 500c06d commit 04e72f0
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!("{backend_database:?} url"))
.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 04e72f0

Please sign in to comment.