fix: correctly escape characters in edition/lang validation. Closes #1270
This commit is contained in:
parent
a7271034cf
commit
9b1c28dbe1
6
quickget
6
quickget
|
@ -199,7 +199,7 @@ function error_not_supported_release() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function error_not_supported_edition() {
|
function error_not_supported_edition() {
|
||||||
if [[ ! "${EDITIONS[*]}" =~ ${EDITION} ]]; then
|
if [[ ! "${EDITIONS[*]}" = *"${EDITION}"* ]]; then
|
||||||
echo -e "ERROR! ${EDITION} is not a supported $(pretty_name "${OS}") edition\n"
|
echo -e "ERROR! ${EDITION} is not a supported $(pretty_name "${OS}") edition\n"
|
||||||
echo -n ' - Supported editions: '
|
echo -n ' - Supported editions: '
|
||||||
for EDITION in "${EDITIONS[@]}"; do
|
for EDITION in "${EDITIONS[@]}"; do
|
||||||
|
@ -3483,8 +3483,6 @@ if [ -n "${2}" ]; then
|
||||||
if [[ $(type -t "editions_${OS}") == function ]]; then
|
if [[ $(type -t "editions_${OS}") == function ]]; then
|
||||||
validate_release "releases_${OS}"
|
validate_release "releases_${OS}"
|
||||||
EDITIONS=("$(editions_"${OS}")")
|
EDITIONS=("$(editions_"${OS}")")
|
||||||
# Default to the first edition if none is specified.
|
|
||||||
EDITION=${EDITIONS[0]}
|
|
||||||
if [ -n "${3}" ]; then
|
if [ -n "${3}" ]; then
|
||||||
EDITION="${3}"
|
EDITION="${3}"
|
||||||
error_not_supported_edition
|
error_not_supported_edition
|
||||||
|
@ -3512,7 +3510,7 @@ if [ -n "${2}" ]; then
|
||||||
"languages_${OS}"
|
"languages_${OS}"
|
||||||
if [ -n "${3}" ]; then
|
if [ -n "${3}" ]; then
|
||||||
I18N="${3}"
|
I18N="${3}"
|
||||||
if [[ ! "${I18NS[*]}" =~ ${I18N} ]]; then
|
if [[ ! "${I18NS[*]}" = *"${I18N}"* ]]; then
|
||||||
error_not_supported_lang
|
error_not_supported_lang
|
||||||
fi
|
fi
|
||||||
VM_PATH="$(echo "${OS}-${RELEASE}-${I18N// /-}" | tr -d '()')"
|
VM_PATH="$(echo "${OS}-${RELEASE}-${I18N// /-}" | tr -d '()')"
|
||||||
|
|
Loading…
Reference in New Issue