all: honour port for -monitor flash flag

This commit is contained in:
Kenneth Bell
2023-04-07 17:17:24 +01:00
committed by Ron Evans
parent af9f19615b
commit 7aac1a1391
+6 -1
View File
@@ -532,7 +532,12 @@ func Flash(pkgName, port string, options *compileopts.Options) error {
return fmt.Errorf("unknown flash method: %s", flashMethod) return fmt.Errorf("unknown flash method: %s", flashMethod)
} }
if options.Monitor { if options.Monitor {
return Monitor("", options) port, err := getDefaultPort(port, config.Target.SerialPort)
if err != nil {
return &commandError{"failed to locate port to monitor", port, err}
}
return Monitor(port, options)
} }
return nil return nil
} }