feat: os_supported_edition function
This commit is contained in:
commit
bf8fa84c4f
20
quickget
20
quickget
|
@ -3662,6 +3662,18 @@ fi
|
||||||
|
|
||||||
LANGS=()
|
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() {
|
os_error_edition() {
|
||||||
echo -en "ERROR! You must specify an edition.\n - Editions: "
|
echo -en "ERROR! You must specify an edition.\n - Editions: "
|
||||||
#TODO ERROR here
|
#TODO ERROR here
|
||||||
|
@ -3810,13 +3822,7 @@ if [ -n "${2}" ]; then
|
||||||
EDITION=${EDITIONS[0]}
|
EDITION=${EDITIONS[0]}
|
||||||
if [ -n "${3}" ]; then
|
if [ -n "${3}" ]; then
|
||||||
EDITION="${3}"
|
EDITION="${3}"
|
||||||
if [[ ! " ${EDITIONS[*]} " =~ " ${EDITION} " ]]; then
|
os_supported_edition
|
||||||
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
|
|
||||||
else
|
else
|
||||||
os_error_edition
|
os_error_edition
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue