feat: os_supported_lang function

This commit is contained in:
Martin Wimpress 2024-04-16 14:10:33 +01:00
commit d96978d1c2
No known key found for this signature in database
GPG Key ID: 61DF940515E06DA3
1 changed files with 10 additions and 5 deletions

View File

@ -3662,6 +3662,15 @@ fi
LANGS=()
os_supported_lang() {
echo -e "ERROR! ${LANG} is not a supported $(pretty_name "${OS}") language\n"
echo -n ' - Editions: '
for LANG in "${LANGS[@]}"; do
echo -n "${LANG} "
done
exit 1
}
handle_missing() {
# Handle odd missing Fedora combinations
if [[ $OS == fedora ]] ; then
@ -3834,11 +3843,7 @@ if [ -n "${2}" ]; then
if [ -n "${3}" ]; then
LANG="${3}"
if [[ ! ${LANGS[*]} =~ "${LANG}" ]]; then
echo -e "ERROR! ${LANG} is not a supported Windows ${RELEASE} language:\n"
for LANG in "${LANGS[@]}"; do
echo -n "${LANG} "
done
exit 1
os_supported_lang
fi
VM_PATH="$(echo "${OS}-${RELEASE}-${LANG// /-}" | tr -d '()')"
fi