mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-31 18:44:27 +02:00
Fix Windows Error 32 while cleanup pioenvs dir
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||||
# See LICENSE for details.
|
# See LICENSE for details.
|
||||||
|
|
||||||
VERSION = (2, 1, "1.dev0")
|
VERSION = (2, 1, "1.dev1")
|
||||||
__version__ = ".".join([str(s) for s in VERSION])
|
__version__ = ".".join([str(s) for s in VERSION])
|
||||||
|
|
||||||
__title__ = "platformio"
|
__title__ = "platformio"
|
||||||
|
@@ -181,19 +181,17 @@ def _clean_pioenvs_dir():
|
|||||||
proj_hash = calculate_project_hash()
|
proj_hash = calculate_project_hash()
|
||||||
|
|
||||||
# if project's config is modified
|
# if project's config is modified
|
||||||
if isdir(pioenvs_dir):
|
if (isdir(pioenvs_dir) and
|
||||||
if (getmtime(join(util.get_project_dir(), "platformio.ini")) >
|
getmtime(join(util.get_project_dir(), "platformio.ini")) >
|
||||||
getmtime(pioenvs_dir)):
|
getmtime(pioenvs_dir)):
|
||||||
rmtree(pioenvs_dir)
|
rmtree(pioenvs_dir)
|
||||||
|
|
||||||
# check project structure
|
# check project structure
|
||||||
if isdir(pioenvs_dir):
|
if isdir(pioenvs_dir) and isfile(structhash_file):
|
||||||
if isfile(structhash_file):
|
with open(structhash_file) as f:
|
||||||
with open(structhash_file) as f:
|
if f.read() == proj_hash:
|
||||||
if f.read() == proj_hash:
|
return
|
||||||
return
|
rmtree(pioenvs_dir)
|
||||||
else:
|
|
||||||
rmtree(pioenvs_dir)
|
|
||||||
|
|
||||||
if not isdir(pioenvs_dir):
|
if not isdir(pioenvs_dir):
|
||||||
makedirs(pioenvs_dir)
|
makedirs(pioenvs_dir)
|
||||||
|
Reference in New Issue
Block a user