Skip to content

Commit

Permalink
feat: handle_missing function
Browse files Browse the repository at this point in the history
  • Loading branch information
flexiondotorg committed Apr 16, 2024
2 parents 29167d8 + 534f7fc commit c3acd28
Showing 1 changed file with 21 additions and 18 deletions.
39 changes: 21 additions & 18 deletions quickget
Original file line number Diff line number Diff line change
Expand Up @@ -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:"
Expand Down Expand Up @@ -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}")"
Expand Down

0 comments on commit c3acd28

Please sign in to comment.