Remove ProjectConfig from cache on saving

This commit is contained in:
Ivan Kravets
2019-08-28 22:43:34 +03:00
parent 883a97a38c
commit 9fa424ea9b
2 changed files with 4 additions and 1 deletions

View File

@ -12,7 +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>`__
* 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

@ -312,6 +312,9 @@ class ProjectConfig(object):
return json.dumps(result)
def save(self, path=None):
path = path or self.path
if path in self._instances:
del self._instances[path]
with open(path or self.path, "w") as fp:
fp.write(CONFIG_HEADER)
self._parser.write(fp)