Added a safety net to language selection

This commit is contained in:
Anton Hvornum 2021-04-14 12:46:18 +02:00 committed by GitHub
parent 48c679d501
commit 1aadfa98c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -14,7 +14,12 @@ def ask_user_questions():
will we continue with the actual installation steps.
"""
if not archinstall.arguments.get('keyboard-language', None):
archinstall.arguments['keyboard-language'] = archinstall.select_language(archinstall.list_keyboard_languages()).strip()
while True:
try:
archinstall.arguments['keyboard-language'] = archinstall.select_language(archinstall.list_keyboard_languages()).strip()
break
except archinstall.RequirementError as err:
archinstall.log(err, fg="red")
# Before continuing, set the preferred keyboard layout/language in the current terminal.
# This will just help the user with the next following questions.