Skip to content
This repository was archived by the owner on Feb 8, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions payload/Library/nudge/Resources/nudge
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,15 @@ def get_os_version():
def get_os_version_major():
'''Return major OS version.'''
full_os = platform.mac_ver()[0]
return LooseVersion(full_os.rsplit('.', 1)[0])

# Sometimes the OS version will return without the dot release
# For example, it may show as 10.15.0 instead of 10.15
if len(full_os.split('.')) == 3:
return LooseVersion(full_os.rsplit('.', 1)[0])
elif len(full_os.split('.')) == 2:
return LooseVersion(full_os)
else:
nudgelog('Cannot reliably determine OS major version. Exiting...')
exit(1)

def get_parsed_options():
'''Return the parsed options and args for this application.'''
Expand Down