mirror of
https://github.com/esphome/esphome.git
synced 2025-10-30 06:33:51 +00:00
[core] Don't remove storage in clean-all (#10921)
This commit is contained in:
@@ -1155,7 +1155,9 @@ def parse_args(argv):
|
||||
"configuration", help="Your YAML configuration file(s).", nargs="+"
|
||||
)
|
||||
|
||||
parser_clean_all = subparsers.add_parser("clean-all", help="Clean all files.")
|
||||
parser_clean_all = subparsers.add_parser(
|
||||
"clean-all", help="Clean all build and platform files."
|
||||
)
|
||||
parser_clean_all.add_argument(
|
||||
"configuration", help="Your YAML configuration directory.", nargs="*"
|
||||
)
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user