From 82cd2feefad1c5974799b797f8196a3a9a1f2009 Mon Sep 17 00:00:00 2001 From: Hoang Hong Quan Date: Sat, 9 Nov 2024 17:25:55 +0700 Subject: [PATCH] Unzip all existing zip files before processing --- Scripts/gathering_files.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Scripts/gathering_files.py b/Scripts/gathering_files.py index 9930885..da35d15 100644 --- a/Scripts/gathering_files.py +++ b/Scripts/gathering_files.py @@ -182,7 +182,17 @@ class gatheringFiles: zip_path = os.path.join(self.temporary_dir, product_name) + ".zip" self.fetcher.download_and_save_file(product_download_url, zip_path) - self.utils.extract_zip_file(zip_path) + + while True: + zip_files = self.utils.find_matching_paths(os.path.join(self.temporary_dir, product_name), extension_filter=".zip") + + if not zip_files: + break + + for zip_file, file_type in zip_files: + full_zip_path = os.path.join(self.temporary_dir, product_name, zip_file) + self.utils.extract_zip_file(full_zip_path) + os.remove(full_zip_path) if "OpenCore" in product_name: ocbinarydata_dir = os.path.join(self.temporary_dir, "OcBinaryData")