mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-04-14 04:38:20 +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():
|
||||
if not kdk_folder.name.endswith(".kdk"):
|
||||
continue
|
||||
|
||||
# Ensure direct match
|
||||
if kdk_folder.name.endswith(f"{search_build}.kdk"):
|
||||
# Verify that the KDK is valid
|
||||
@@ -119,9 +122,13 @@ class sys_patch_helpers:
|
||||
return kdk_folder
|
||||
if match_closest is True:
|
||||
# ex: KDK_13.0_22A5266r.kdk -> 22A5266r.kdk -> 22A5266r
|
||||
build = kdk_folder.name.split("_")[2].split(".")[0]
|
||||
if build.startswith(str(search_build)):
|
||||
kdk_array.append(build)
|
||||
try:
|
||||
build = kdk_folder.name.split("_")[2].split(".")[0]
|
||||
# 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:
|
||||
result = os_data.os_conversion.find_largest_build(kdk_array)
|
||||
|
||||
Reference in New Issue
Block a user