1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-12 06:43:48 +01:00

[core] Don't remove storage in clean-all (#10921)

This commit is contained in:
Jonathan Swoboda
2025-09-29 15:24:42 -04:00
committed by GitHub
parent 2aaafd6ebb
commit b176d1f890
3 changed files with 137 additions and 12 deletions

View File

@@ -340,10 +340,15 @@ def clean_all(configuration: list[str]):
# Clean entire build dir
for dir in configuration:
buid_dir = Path(dir) / ".esphome"
if buid_dir.is_dir():
_LOGGER.info("Deleting %s", buid_dir)
shutil.rmtree(buid_dir)
build_dir = Path(dir) / ".esphome"
if build_dir.is_dir():
_LOGGER.info("Cleaning %s", build_dir)
# Don't remove storage as it will cause the dashboard to regenerate all configs
for item in build_dir.iterdir():
if item.is_file():
item.unlink()
elif item.name != "storage" and item.is_dir():
shutil.rmtree(item)
# Clean PlatformIO project files
try: