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 (#693)

* If a port was specified via CLI or config, search *all* serial ports, not just the filtered list

* Update `CHANGELOG.md`
  • Loading branch information
jessebraham authored Oct 24, 2024
1 parent 853d39b commit 8db0081
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- Only filter the list of available serial ports if a port has not been specified via CLI option or configuration file (#693)

### Removed

## [3.2.0]
Expand Down
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 8db0081

Please sign in to comment.