feat: os_supported_edition function
This commit is contained in:
commit
bf8fa84c4f
20
quickget
20
quickget
|
@ -3662,6 +3662,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
|
||||
}
|
||||
|
||||
os_error_edition() {
|
||||
echo -en "ERROR! You must specify an edition.\n - Editions: "
|
||||
#TODO ERROR here
|
||||
|
@ -3810,13 +3822,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
|
||||
os_error_edition
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue