feat: handle_missing function

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

View File

@ -3662,6 +3662,26 @@ fi
LANGS=()
handle_missing() {
# Handle odd missing Fedora combinations
if [[ $OS == fedora ]] ; then
if [[ ${RELEASE} = "33" && ${EDITION} = "i3" ]] || [[ ${RELEASE} = "34" && ${EDITION} = "Cinnamon" ]] || [[ "${RELEASE}" < "39" && ${EDITION} = "Onyx" ]]; then
echo "ERROR! Unsupported combination"
echo " Fedora ${RELEASE} ${EDITION} is not available, please choose another Release or Edition"
exit 1;
fi
fi
# Handle missing Manjaro Sway minimal
if [[ $OS == manjaro ]] ; then
if [[ ${RELEASE} == "sway" && ${EDITION} == "minimal" ]] ; then
echo "ERROR! Unsupported combination"
echo " Manjaro Sway does not have a minimal edition"
exit 1;
fi
fi
}
os_error() {
echo "ERROR! You must specify an operating system."
echo "- Supported Operating Systems:"
@ -3787,24 +3807,7 @@ if [ -n "${2}" ]; then
exit 1
fi
# Handle odd missing fedora cominations
if [[ $OS == fedora ]] ; then
if [[ ${RELEASE} = "33" && ${EDITION} = "i3" ]] || [[ ${RELEASE} = "34" && ${EDITION} = "Cinnamon" ]] || [[ "${RELEASE}" < "39" && ${EDITION} = "Onyx" ]]; then
echo "ERROR! Unsupported combination"
echo " Fedora ${RELEASE} ${EDITION} is not available, please choose another Release or Edition"
exit 1;
fi
fi
# Handle missing Mangaro Sway minimal
if [[ $OS == manjaro ]] ; then
if [[ ${RELEASE} == "sway" && ${EDITION} == "minimal" ]] ; then
echo "ERROR! Unsupported combination"
echo " Manjaro Sway does not have a minimal edition"
exit 1;
fi
fi
handle_missing
VM_PATH="${OS}-${RELEASE}-${EDITION}"
create_vm "$("get_${OS}" "${EDITION}")"