diff --git a/.bin/Scripts/system_setup.py b/.bin/Scripts/system_setup.py index b3f8279a..c1d8321a 100644 --- a/.bin/Scripts/system_setup.py +++ b/.bin/Scripts/system_setup.py @@ -155,6 +155,19 @@ SETUP_QUESTIONS = { # Functions +def check_os_and_abort(): + """Check OS and prompt to abort if not supported.""" + result = try_and_print( + message='OS support status...', + function=check_os_support_status, + cs='GOOD', + ) + if not result['CS'] and 'Unsupported' in result['Error']: + print_warning('OS version not supported by this script') + if not ask('Continue anyway? (NOT RECOMMENDED)'): + abort() + + def get_actions(setup_mode, answers): """Get actions to perform based on setup_mode, returns OrderedDict.""" actions = OrderedDict({}) @@ -292,15 +305,7 @@ def main(): clear_screen() # Check installed OS - result = try_and_print( - message='OS support status...', - function=check_os_support_status, - cs='GOOD', - ) - if not result['CS'] and 'Unsupported' in result['Error']: - print_warning('OS version not supported by this script') - if not ask('Continue anyway? (NOT RECOMMENDED)'): - abort() + check_os_and_abort() # Get setup mode setup_mode = get_mode()