Skip to content

Commit

Permalink
fix: validate_release function
Browse files Browse the repository at this point in the history
  • Loading branch information
zen0bit authored and flexiondotorg committed Apr 17, 2024
1 parent ea454ae commit f0fb2c8
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions quickget
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit f0fb2c8

Please sign in to comment.