mirror of
https://github.com/esphome/esphome.git
synced 2025-01-09 14:21:46 +01:00
parent
9770bc371b
commit
947a6034e3
1 changed files with 2 additions and 18 deletions
|
@ -29,11 +29,10 @@ def patch_structhash():
|
||||||
from platformio.project.helpers import get_project_dir
|
from platformio.project.helpers import get_project_dir
|
||||||
else:
|
else:
|
||||||
from platformio.util import get_project_dir
|
from platformio.util import get_project_dir
|
||||||
from os.path import join, isdir, getmtime, isfile
|
from os.path import join, isdir, getmtime
|
||||||
from os import makedirs
|
from os import makedirs
|
||||||
|
|
||||||
def patched_clean_build_dir(build_dir):
|
def patched_clean_build_dir(build_dir, *args):
|
||||||
structhash_file = join(build_dir, "structure.hash")
|
|
||||||
platformio_ini = join(get_project_dir(), "platformio.ini")
|
platformio_ini = join(get_project_dir(), "platformio.ini")
|
||||||
|
|
||||||
# if project's config is modified
|
# if project's config is modified
|
||||||
|
@ -43,21 +42,6 @@ def patch_structhash():
|
||||||
if not isdir(build_dir):
|
if not isdir(build_dir):
|
||||||
makedirs(build_dir)
|
makedirs(build_dir)
|
||||||
|
|
||||||
if is_platformio4():
|
|
||||||
from platformio.project import helpers
|
|
||||||
proj_hash = helpers.calculate_project_hash()
|
|
||||||
else:
|
|
||||||
proj_hash = run.calculate_project_hash()
|
|
||||||
|
|
||||||
# check project structure
|
|
||||||
if isdir(build_dir) and isfile(structhash_file):
|
|
||||||
with open(structhash_file) as f:
|
|
||||||
if f.read() == proj_hash:
|
|
||||||
return
|
|
||||||
|
|
||||||
with open(structhash_file, "w") as f:
|
|
||||||
f.write(proj_hash)
|
|
||||||
|
|
||||||
# pylint: disable=protected-access
|
# pylint: disable=protected-access
|
||||||
if is_platformio4():
|
if is_platformio4():
|
||||||
run.helpers.clean_build_dir = patched_clean_build_dir
|
run.helpers.clean_build_dir = patched_clean_build_dir
|
||||||
|
|
Loading…
Reference in a new issue