From 1b9eb20ba61e1a0e348413196176003367e03df0 Mon Sep 17 00:00:00 2001 From: Martin Wimpress Date: Tue, 19 Oct 2021 16:33:03 +0100 Subject: [PATCH] Add validate_release() function --- quickget | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/quickget b/quickget index 98515e0..ef07660 100755 --- a/quickget +++ b/quickget @@ -20,6 +20,21 @@ function pretty_name() { esac echo "${PRETTY_NAME}" } + +function validate_release() { + local DISPLAY_NAME="" + local RELEASE_GENERATOR="${1}" + local RELEASES="" + + DISPLAY_NAME="$(pretty_name "${OS}")" + RELEASES=$(${RELEASE_GENERATOR}) + if [[ "${RELEASES}" != *"${RELEASE}"* ]]; then + echo "ERROR! ${DISPLAY_NAME} ${RELEASE} is not a supported release." + echo "${RELEASES}" + exit 1 + fi +} + function list_all() { local DISPLAY_NAME local FUNC