fix(cli): do not prompt for device when --open is provided

This commit is contained in:
Lucas Nogueira 2023-01-26 12:33:52 -03:00
parent 1af9be904a
commit 8835633955
No known key found for this signature in database
GPG Key ID: FFEA6C72E73482F1
2 changed files with 18 additions and 10 deletions

View File

@ -99,12 +99,16 @@ fn run_dev(
) -> Result<()> { ) -> Result<()> {
setup_dev_config(&mut options.config)?; setup_dev_config(&mut options.config)?;
let env = env()?; let env = env()?;
let device = match device_prompt(&env, options.device.as_deref()) { let device = if options.open {
None
} else {
match device_prompt(&env, options.device.as_deref()) {
Ok(d) => Some(d), Ok(d) => Some(d),
Err(e) => { Err(e) => {
log::error!("{e}"); log::error!("{e}");
None None
} }
}
}; };
let mut dev_options: DevOptions = options.clone().into(); let mut dev_options: DevOptions = options.clone().into();

View File

@ -113,12 +113,16 @@ fn run_dev(
) -> Result<()> { ) -> Result<()> {
setup_dev_config(&mut options.config)?; setup_dev_config(&mut options.config)?;
let env = env()?; let env = env()?;
let device = match device_prompt(&env, options.device.as_deref()) { let device = if options.open {
None
} else {
match device_prompt(&env, options.device.as_deref()) {
Ok(d) => Some(d), Ok(d) => Some(d),
Err(e) => { Err(e) => {
log::error!("{e}"); log::error!("{e}");
None None
} }
}
}; };
let mut dev_options: DevOptions = options.clone().into(); let mut dev_options: DevOptions = options.clone().into();