mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 10:07:14 +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>
|
||||
# See LICENSE for details.
|
||||
|
||||
VERSION = (2, 1, "1.dev0")
|
||||
VERSION = (2, 1, "1.dev1")
|
||||
__version__ = ".".join([str(s) for s in VERSION])
|
||||
|
||||
__title__ = "platformio"
|
||||
|
@ -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)
|
||||
|
Reference in New Issue
Block a user