From f0fb2c8f6f2d62420ccf75d7815c96c759c86f2c Mon Sep 17 00:00:00 2001 From: zen0bit Date: Wed, 17 Apr 2024 02:52:57 +0200 Subject: [PATCH] fix: validate_release function --- quickget | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/quickget b/quickget index 1c9d70d..5ca1975 100755 --- a/quickget +++ b/quickget @@ -286,23 +286,17 @@ function pretty_name_new() { } function validate_release() { - local DISPLAY_NAME="" - local RELEASE_GENERATOR="" - local RELEASES="" - - DISPLAY_NAME="$(pretty_name "${OS}")" - case ${OS} in - *ubuntu-server*) RELEASE_GENERATOR="releases_ubuntu-server";; - *ubuntu*) RELEASE_GENERATOR="releases_ubuntu";; - *) RELEASE_GENERATOR="${1}";; - esac - - RELEASES=$(${RELEASE_GENERATOR}) - if [[ ! " ${RELEASES[*]} " =~ " ${RELEASE} " ]]; then - echo -e "ERROR! ${DISPLAY_NAME} ${RELEASE} is not a supported release.\n" - echo -n "${RELEASES}" - exit 1 - fi + local DISPLAY_NAME="" + local RELEASE_GENERATOR="" + local RELEASES="" + DISPLAY_NAME="$(pretty_name "${OS}")" + case ${OS} in + *ubuntu-server*) RELEASE_GENERATOR="releases_ubuntu-server";; + *ubuntu*) RELEASE_GENERATOR="releases_ubuntu";; + *) RELEASE_GENERATOR="${1}";; + esac + RELEASES=$(${RELEASE_GENERATOR}) + os_supported_release } function list_json() {