Skip to content
This repository was archived by the owner on Feb 8, 2023. It is now read-only.

Commit 57fd93f

Browse files
committed
Actually handle big sur logic
1 parent 4625084 commit 57fd93f

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

  • payload/Library/nudge/Resources

payload/Library/nudge/Resources/nudge

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,15 @@ def get_os_version():
193193
def get_os_version_major():
194194
'''Return major OS version.'''
195195
full_os = platform.mac_ver()[0]
196+
# Handle Big Sur and higher since major version is now the first portion
197+
split_os = full_os.split('.')
198+
if LooseVersion(split_os[0]) >= LooseVersion('11'):
199+
return LooseVersion(split_os[0])
196200
# Sometimes the OS version will return without the dot release
197201
# For example, it may show as 10.15.0 instead of 10.15
198-
if len(full_os.split('.')) == 3:
202+
if len(split_os) == 3:
199203
return LooseVersion(full_os.rsplit('.', 1)[0])
200-
elif len(full_os.split('.')) == 2:
204+
elif len(split_os) == 2:
201205
return LooseVersion(full_os)
202206
else:
203207
nudgelog('Cannot reliably determine OS major version. Exiting...')
@@ -514,6 +518,11 @@ def main():
514518
if '.' not in minimum_os_version_major:
515519
minimum_os_version_major = minimum_os_version
516520

521+
# Handle Big Sur and higher since major version is now the first portion
522+
split_minimum_os_version_major = minimum_os_version_major.split('.')
523+
if LooseVersion(split_minimum_os_version_major[0]) >= LooseVersion('11'):
524+
minimum_os_version_major = split_minimum_os_version_major[0]
525+
517526
os_version = get_os_version()
518527
os_version_major = get_os_version_major()
519528
os_version_sub_build = get_os_sub_build_version()

0 commit comments

Comments
 (0)