Add validate_release() function

This commit is contained in:
Martin Wimpress 2021-10-19 16:33:03 +01:00 committed by Martin Wimpress
parent 7d003eda88
commit 1b9eb20ba6
1 changed files with 15 additions and 0 deletions

View File

@ -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