fix corrupted nodes

This commit is contained in:
Florin Barbu 2024-07-24 21:28:11 +03:00
parent d9ee2ff0d0
commit a2afdf7e6c
No known key found for this signature in database
GPG Key ID: 593D6DBC6D9E5095
11 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,19 @@
import os
import tarfile
root_folder = "." # Set your root folder path here
resources_folder = os.path.join(root_folder, "resources")
# Ensure the resources folder exists
os.makedirs(resources_folder, exist_ok=True)
# Iterate over all items in the resources folder
for item in os.listdir(resources_folder):
item_path = os.path.join(resources_folder, item)
if os.path.isdir(item_path):
# Archive the folder
archive_name = f"{item}.tar"
archive_path = os.path.join(resources_folder, archive_name)
with tarfile.open(archive_path, "w") as tar:
tar.add(item_path, arcname=item)