Fix an issue when `pio run -t monitor always uses first monitor_port` even with multiple environments // Resolve #1841

This commit is contained in:
Ivan Kravets
2018-10-12 21:57:57 +03:00
parent d4e553fb5a
commit 69d01c4bc1
2 changed files with 6 additions and 1 deletions

View File

@ -21,6 +21,9 @@ PlatformIO 3.0
(`issue #1823 <https://github.com/platformio/platformio-core/issues/1823>`_)
* Fixed an issue when dynamic build flags were not handled correctly
(`issue #1799 <https://github.com/platformio/platformio-core/issues/1799>`_)
* Fixed an issue when ``pio run -t monitor`` always uses first ``monitor_port``
even with multiple environments
(`issue #1841 <https://github.com/platformio/platformio-core/issues/1841>`_)
3.6.0 (2018-08-06)
~~~~~~~~~~~~~~~~~~

View File

@ -108,7 +108,9 @@ def cli(ctx, environment, target, upload_port, project_dir, silent, verbose,
results.append(result)
if result[1] and "monitor" in ep.get_build_targets() and \
"nobuild" not in ep.get_build_targets():
ctx.invoke(cmd_device_monitor)
ctx.invoke(
cmd_device_monitor,
environment=environment[0] if environment else None)
found_error = any(status is False for (_, status) in results)