diff --git a/platformio/__init__.py b/platformio/__init__.py index 2676be49..db1c3d33 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -1,7 +1,7 @@ # Copyright (C) Ivan Kravets # See LICENSE for details. -VERSION = (2, 1, "1.dev0") +VERSION = (2, 1, "1.dev1") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" diff --git a/platformio/commands/run.py b/platformio/commands/run.py index 081bc20d..1ee3e476 100644 --- a/platformio/commands/run.py +++ b/platformio/commands/run.py @@ -181,19 +181,17 @@ def _clean_pioenvs_dir(): proj_hash = calculate_project_hash() # if project's config is modified - if isdir(pioenvs_dir): - if (getmtime(join(util.get_project_dir(), "platformio.ini")) > - getmtime(pioenvs_dir)): + if (isdir(pioenvs_dir) and + getmtime(join(util.get_project_dir(), "platformio.ini")) > + getmtime(pioenvs_dir)): rmtree(pioenvs_dir) # check project structure - if isdir(pioenvs_dir): - if isfile(structhash_file): - with open(structhash_file) as f: - if f.read() == proj_hash: - return - else: - rmtree(pioenvs_dir) + if isdir(pioenvs_dir) and isfile(structhash_file): + with open(structhash_file) as f: + if f.read() == proj_hash: + return + rmtree(pioenvs_dir) if not isdir(pioenvs_dir): makedirs(pioenvs_dir)