Skip to content

Commit

Permalink
feat: os_supported_edition function
Browse files Browse the repository at this point in the history
  • Loading branch information
zen0bit committed Apr 15, 2024
1 parent bea27b1 commit 0eee124
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions quickget
Original file line number Diff line number Diff line change
Expand Up @@ -3443,6 +3443,18 @@ fi

LANGS=()

os_supported_edition() {
if [[ ! " ${EDITIONS[*]} " =~ " ${EDITION} " ]]; then
echo -e "ERROR! ${EDITION} is not a supported $(pretty_name "${OS}") edition\n"
echo -n ' - Editions: '
for EDITION in "${EDITIONS[@]}"; do
echo -n "${EDITION} "
done
echo ""
exit 1
fi
}

if [ -n "${1}" ]; then
OS="${1,,}"
if [ "${OS}" == "list" ] || [ "${OS}" == "list_csv" ]; then
Expand Down Expand Up @@ -3488,13 +3500,7 @@ if [ -n "${2}" ]; then
EDITION=${EDITIONS[0]}
if [ -n "${3}" ]; then
EDITION="${3}"
if [[ ! " ${EDITIONS[*]} " =~ " ${EDITION} " ]]; then
echo -e "ERROR! ${EDITION} is not a supported $(pretty_name "${OS}") edition:\n"
for EDITION in "${EDITIONS[@]}"; do
echo -n "${EDITION} "
done
exit 1
fi
os_supported_edition
else
echo -en "ERROR! You must specify an edition.\n - Editions: "
editions_"${OS}"
Expand Down

0 comments on commit 0eee124

Please sign in to comment.