1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-29 22:24:26 +00:00
This commit is contained in:
J. Nick Koston
2025-09-15 17:19:28 -05:00
parent 313851f4df
commit fa00e07e10
2 changed files with 15 additions and 12 deletions

View File

@@ -1038,12 +1038,11 @@ 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:
# Move build folder to archive (if exists)
name = storage_json.name
build_folder = os.path.join(settings.config_dir, name)
if storage_json is not None and storage_json.build_path:
# Delete build folder (if exists)
build_folder = storage_json.build_path
if os.path.exists(build_folder):
shutil.move(build_folder, os.path.join(archive_path, name))
shutil.rmtree(build_folder, ignore_errors=True)
class UnArchiveRequestHandler(BaseHandler):