Skip to content

Commit

Permalink
If a port was specified via CLI or config, search *all* serial ports,…
Browse files Browse the repository at this point in the history
… not just the filtered list
  • Loading branch information
jessebraham committed Oct 24, 2024
1 parent 853d39b commit 7b6de2a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions espflash/src/cli/serial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@ pub fn get_serial_port_info(
// doesn't work (on Windows) with "dummy" device paths like `COM4`. That's
// the reason we need to handle Windows/Posix differently.

let ports = detect_usb_serial_ports(matches.list_all_ports).unwrap_or_default();

if let Some(serial) = &matches.port {
let ports = detect_usb_serial_ports(true).unwrap_or_default();
find_serial_port(&ports, serial)
} else if let Some(serial) = &config.connection.serial {
let ports = detect_usb_serial_ports(true).unwrap_or_default();
find_serial_port(&ports, serial)
} else {
let ports = detect_usb_serial_ports(matches.list_all_ports).unwrap_or_default();
let (port, matches) = select_serial_port(ports, config, matches.confirm_port)?;

match &port.port_type {
Expand Down

0 comments on commit 7b6de2a

Please sign in to comment.