Skip to content

Commit 8db0081

Browse files
authored
If a port was specified via CLI or config, search *all* serial ports, 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`
1 parent 853d39b commit 8db0081

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313

1414
### Fixed
1515

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

1820
## [3.2.0]

espflash/src/cli/serial.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,14 @@ pub fn get_serial_port_info(
3333
// doesn't work (on Windows) with "dummy" device paths like `COM4`. That's
3434
// the reason we need to handle Windows/Posix differently.
3535

36-
let ports = detect_usb_serial_ports(matches.list_all_ports).unwrap_or_default();
37-
3836
if let Some(serial) = &matches.port {
37+
let ports = detect_usb_serial_ports(true).unwrap_or_default();
3938
find_serial_port(&ports, serial)
4039
} else if let Some(serial) = &config.connection.serial {
40+
let ports = detect_usb_serial_ports(true).unwrap_or_default();
4141
find_serial_port(&ports, serial)
4242
} else {
43+
let ports = detect_usb_serial_ports(matches.list_all_ports).unwrap_or_default();
4344
let (port, matches) = select_serial_port(ports, config, matches.confirm_port)?;
4445

4546
match &port.port_type {

0 commit comments

Comments
 (0)