feat: Move not supported edition message into function
This commit is contained in:
parent
bea27b1ffa
commit
cb33fa0bc8
20
quickget
20
quickget
|
@ -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
|
||||
|
@ -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}"
|
||||
|
|
Loading…
Reference in New Issue