From 32ae0b2ef972a137b1a39d2b4132ec0a9dd680b1 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk <48863253+khronokernel@users.noreply.github.com> Date: Mon, 30 Nov 2020 22:00:11 -0700 Subject: [PATCH] Update BuildOpenCore.py --- Resources/BuildOpenCore.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Resources/BuildOpenCore.py b/Resources/BuildOpenCore.py index f5ada776e..6f921ef37 100644 --- a/Resources/BuildOpenCore.py +++ b/Resources/BuildOpenCore.py @@ -277,14 +277,15 @@ def MoveOpenCore(): print("") print("Coping OpenCore onto Volumes/EFI") efiVol = "/Volumes/EFI" - if os.path.exists("/Volumes/EFI/EFI"): - print("Cleaning EFI folder") - rmtree("/Volumes/EFI/EFI") - if os.path.exists(Versions.opencore_path_done): - copy_tree(Versions.opencore_path_done, efiVol) - copy(Versions.icon_path, efiVol) - print("OpenCore transfer complete") - print("") + if os.path.exists(efiVol): + if os.path.exists("/Volumes/EFI/EFI"): + print("Cleaning EFI folder") + rmtree("/Volumes/EFI/EFI") + if os.path.exists(Versions.opencore_path_done): + copy_tree(Versions.opencore_path_done, efiVol) + copy(Versions.icon_path, efiVol) + print("OpenCore transfer complete") + print("") def MountOpenCore(): subprocess.Popen((r"sudo diskutil mount $(nvram 4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102:boot-path | sed 's/.*GPT,\([^,]*\),.*/\1/')").split()) \ No newline at end of file