mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-06-20 14:10:51 +10:00
sys_patch_helpers: Fix index error on .DS_Store files
Thanks @hvds
This commit is contained in:
@@ -112,6 +112,9 @@ class sys_patch_helpers:
|
|||||||
|
|
||||||
|
|
||||||
for kdk_folder in Path("/Library/Developer/KDKs").iterdir():
|
for kdk_folder in Path("/Library/Developer/KDKs").iterdir():
|
||||||
|
if not kdk_folder.name.endswith(".kdk"):
|
||||||
|
continue
|
||||||
|
|
||||||
# Ensure direct match
|
# Ensure direct match
|
||||||
if kdk_folder.name.endswith(f"{search_build}.kdk"):
|
if kdk_folder.name.endswith(f"{search_build}.kdk"):
|
||||||
# Verify that the KDK is valid
|
# Verify that the KDK is valid
|
||||||
@@ -119,9 +122,13 @@ class sys_patch_helpers:
|
|||||||
return kdk_folder
|
return kdk_folder
|
||||||
if match_closest is True:
|
if match_closest is True:
|
||||||
# ex: KDK_13.0_22A5266r.kdk -> 22A5266r.kdk -> 22A5266r
|
# ex: KDK_13.0_22A5266r.kdk -> 22A5266r.kdk -> 22A5266r
|
||||||
build = kdk_folder.name.split("_")[2].split(".")[0]
|
try:
|
||||||
if build.startswith(str(search_build)):
|
build = kdk_folder.name.split("_")[2].split(".")[0]
|
||||||
kdk_array.append(build)
|
# Don't append if Darwin Major is different
|
||||||
|
if build.startswith(str(self.constants.detected_os)):
|
||||||
|
kdk_array.append(build)
|
||||||
|
except IndexError:
|
||||||
|
pass
|
||||||
|
|
||||||
if match_closest is True:
|
if match_closest is True:
|
||||||
result = os_data.os_conversion.find_largest_build(kdk_array)
|
result = os_data.os_conversion.find_largest_build(kdk_array)
|
||||||
|
|||||||
Reference in New Issue
Block a user