feat: Rewrite list_isos function for one OS only

dirty
This commit is contained in:
zen0bit 2024-04-23 01:02:13 +02:00 committed by Martin Wimpress
parent 5e2351a446
commit 76521b9479
1 changed files with 13 additions and 12 deletions

View File

@ -384,18 +384,19 @@ function list_supported() {
} }
function list_isos() { function list_isos() {
local showIsoUrl=on
local DIR="/dev/null" local DIR="/dev/null"
local URL local URL
local FUNC local FUNC
local OPTION local OPTION
local OS local OS="${1}"
for OS in $(os_support); do if [[ "${OS}" == *ubuntu-server* ]]; then
case ${OS} in FUNC="ubuntu-server"
*ubuntu-server*) FUNC="ubuntu-server";; elif [[ "${OS}" == *ubuntu* ]]; then
*ubuntu*) FUNC="ubuntu";; FUNC="ubuntu"
*) FUNC="${OS}";; else
esac FUNC="${OS}"
fi
for OS in ${FUNC}; do
for RELEASE in $("releases_${FUNC}" | sed -Ee 's/eol-\S+//g' ); do # hide eol releases for RELEASE in $("releases_${FUNC}" | sed -Ee 's/eol-\S+//g' ); do # hide eol releases
if [[ $(type -t "editions_${OS}") == function ]]; then if [[ $(type -t "editions_${OS}") == function ]]; then
for OPTION in $(editions_"${OS}"); do for OPTION in $(editions_"${OS}"); do
@ -413,12 +414,12 @@ function list_isos() {
elif [[ "${OS}" == "macos" ]]; then elif [[ "${OS}" == "macos" ]]; then
validate_release releases_"${OS}" validate_release releases_"${OS}"
get_macos || echo "ERROR! - ${OS} ${RELEASE} ${OPTION}" get_macos || echo "ERROR! - ${OS} ${RELEASE} ${OPTION}"
elif [[ "${OS}" == *"ubuntu"* ]]; then elif [[ "${OS}" == *ubuntu-server* ]]; then
validate_release releases_ubuntu
get_ubuntu || echo "ERROR! - ${OS} ${RELEASE}"
elif [[ "${OS}" == *"ubuntu-server"* ]]; then
validate_release releases_ubuntu validate_release releases_ubuntu
get_ubuntu-server || echo "ERROR! - ${OS} ${RELEASE}" get_ubuntu-server || echo "ERROR! - ${OS} ${RELEASE}"
elif [[ "${OS}" == *ubuntu* ]]; then
validate_release releases_ubuntu
get_ubuntu || echo "ERROR! - ${OS} ${RELEASE}"
else else
validate_release releases_"${OS}" validate_release releases_"${OS}"
get_"${OS}" "${RELEASE}" | cut_1 || echo "ERROR! - ${OS} ${RELEASE}" get_"${OS}" "${RELEASE}" | cut_1 || echo "ERROR! - ${OS} ${RELEASE}"