Skip to content

Commit

Permalink
feat: handle_missing
Browse files Browse the repository at this point in the history
  • Loading branch information
zen0bit committed Apr 13, 2024
1 parent 88f99c7 commit 0abdfc8
Showing 1 changed file with 21 additions and 17 deletions.
38 changes: 21 additions & 17 deletions quickget
Original file line number Diff line number Diff line change
Expand Up @@ -3635,6 +3635,26 @@ os_supported_lang() {
exit 1
}

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
}

function show_os_info() {
local OS=""
if [ -z "${1}" ]; then
Expand Down Expand Up @@ -3754,23 +3774,7 @@ if [ -n "${2}" ]; then
os_error_edition
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}")"
Expand Down

0 comments on commit 0abdfc8

Please sign in to comment.