Add option to launch Auto Repairs from Auto Setup

Addresses issue #33
This commit is contained in:
2Shirt 2023-06-26 09:47:40 -07:00
parent ea4942bbc4
commit 7156578124
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C

View file

@ -176,9 +176,15 @@ def check_if_av_scan_is_needed():
# Check date and prompt tech if necessary
last_run_date = datetime.strptime(last_run, '%Y-%m-%d')
if datetime.now() - last_run_date < timedelta(days=FAB_TIMEFRAME):
ui.print_warning('Fab was recently run, an AV scan may be needed.')
if not ui.ask('Continue with setup?'):
ui.print_warning('Fab was recently run, Auto Repairs may be needed.')
selection = ui.choice(
'Continue with Auto Setup, run Auto Repairs, or Quit?', ['C', 'R', 'Q'],
)
if selection == 'Q':
ui.abort()
if selection == 'R':
auto_repairs_script = find_kit_dir('Scripts').joinpath('auto_repairs.py')
os.execv(sys.executable, ['python', auto_repairs_script])
def check_os_and_set_menu_title(title) -> str: