Stop and display an error if any occur while deleting unnecessary files in the OpenCore EFI

This commit is contained in:
Hoang Hong Quan
2024-07-27 08:24:28 +07:00
parent 8abd260de4
commit acd4b85f30

View File

@@ -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")