1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-29 16:42:19 +01:00

[dashboard] Fix archive handler incorrectly deleting build folders instead of archiving them

This commit is contained in:
J. Nick Koston
2025-09-14 19:22:33 -05:00
parent af3e1788d1
commit f857fa1f0d
2 changed files with 122 additions and 12 deletions

View File

@@ -1039,11 +1039,11 @@ class ArchiveRequestHandler(BaseHandler):
storage_json = StorageJSON.load(storage_path)
if storage_json is not None:
# Delete build folder (if exists)
# Move build folder to archive (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))
if os.path.exists(build_folder):
shutil.move(build_folder, os.path.join(archive_path, name))
class UnArchiveRequestHandler(BaseHandler):