Fixed an issue when --upload-port CLI flag does not override declared upload_port option in "platformio.ini"

This commit is contained in:
Ivan Kravets
2019-08-28 19:56:09 +03:00
parent c671a8e235
commit 883a97a38c
3 changed files with 4 additions and 1 deletions

View File

@ -12,6 +12,7 @@ PlatformIO 4.0
* Update SCons tool to 3.1.1
* Remove ProjectConfig cache when "platformio.ini" was modified outside
* Fixed an issue with PIO Unified Debugger on Windows OS when debug server is piped
* Fixed an issue when `--upload-port <http://docs.platformio.org/page/userguide/cmd_run.html#cmdoption-platformio-run-upload-port>`__ CLI flag does not override declared `upload_port <http://docs.platformio.org/page/projectconf/section_env_upload.html#upload-port>`_ option in `"platformio.ini" (Project Configuration File) <https://docs.platformio.org/page/projectconf.html>`__
4.0.2 (2019-08-23)
~~~~~~~~~~~~~~~~~~

View File

@ -97,6 +97,7 @@ env.Replace(
for key in list(clivars.keys()) if key in env
})
if env.subst("$BUILDCACHE_DIR"):
if not isdir(env.subst("$BUILDCACHE_DIR")):
makedirs(env.subst("$BUILDCACHE_DIR"))

View File

@ -32,7 +32,8 @@ def GetProjectOption(env, option, default=None):
def LoadProjectOptions(env):
for option, value in env.GetProjectOptions():
option_meta = ProjectOptions.get("env." + option)
if not option_meta or not option_meta.buildenvvar:
if (not option_meta or not option_meta.buildenvvar
or option_meta.buildenvvar in env):
continue
env[option_meta.buildenvvar] = value