1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-30 06:33:51 +00:00

[dashboard] Fix archive handler to properly delete build folders using correct path (#10724)

This commit is contained in:
J. Nick Koston
2025-09-15 18:04:35 -05:00
committed by GitHub
parent a723673dcc
commit 4859fe67eb
3 changed files with 103 additions and 6 deletions

View File

@@ -1038,12 +1038,9 @@ class ArchiveRequestHandler(BaseHandler):
shutil.move(config_file, os.path.join(archive_path, configuration))
storage_json = StorageJSON.load(storage_path)
if storage_json is not None:
if storage_json is not None and storage_json.build_path:
# Delete build folder (if exists)
name = storage_json.name
build_folder = os.path.join(settings.config_dir, name)
if build_folder is not None:
shutil.rmtree(build_folder, os.path.join(archive_path, name))
shutil.rmtree(storage_json.build_path, ignore_errors=True)
class UnArchiveRequestHandler(BaseHandler):