From acd4b85f3080712cb15a5befe69b30843e7b6c33 Mon Sep 17 00:00:00 2001 From: Hoang Hong Quan Date: Sat, 27 Jul 2024 08:24:28 +0700 Subject: [PATCH] Stop and display an error if any occur while deleting unnecessary files in the OpenCore EFI --- Scripts/efi_builder.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Scripts/efi_builder.py b/Scripts/efi_builder.py index f504848..e0a66cb 100755 --- a/Scripts/efi_builder.py +++ b/Scripts/efi_builder.py @@ -357,6 +357,7 @@ class builder: if not tool_path in tool_loaded: files_to_remove.append(os.path.join(tools_directory, tool_path)) + error = None for path in files_to_remove: try: if os.path.isdir(path): @@ -364,9 +365,14 @@ class builder: else: os.remove(path) except Exception as e: - print(f"Failed to remove file: {e}") + error = True + print(f"\nFailed to remove file: {e}", end="") continue + if error: + print("") + self.utils.request_input() + def build_efi(self, hardware, macos_version): efi_directory = os.path.join(os.getcwd(), "Results")