Don't unnecessarily fetch editions for each release

This commit is contained in:
Liam 2024-04-20 16:52:04 -07:00 committed by Martin Wimpress
parent 95b6d8cf41
commit f1ebc0c505
1 changed files with 7 additions and 2 deletions

View File

@ -313,6 +313,7 @@ function csv_data() {
fi
for OS in $(os_support); do
local EDITIONS=""
DISPLAY_NAME="$(pretty_name "${OS}")"
case ${OS} in
@ -324,6 +325,10 @@ function csv_data() {
PNG="https://quickemu-project.github.io/quickemu-icons/png/${FUNC}/${FUNC}-quickemu-white-pinkbg.png"
SVG="https://quickemu-project.github.io/quickemu-icons/svg/${FUNC}/${FUNC}-quickemu-white-pinkbg.svg"
if [[ $(type -t "editions_${OS}") == function ]]; then
EDITIONS=$(editions_"${OS}")
fi
for RELEASE in $("releases_${FUNC}" | sed -Ee 's/eol-\S+//g' ); do # hide eol releases
if [[ "${OS}" == *"ubuntu"* ]] && [[ ${RELEASE} == *"daily"* ]] && [ ${HAS_ZSYNC} -eq 1 ]; then
DOWNLOADER="zsync"
@ -332,8 +337,8 @@ function csv_data() {
fi
# If the OS has an editions_() function, use it.
if [[ $(type -t "editions_${OS}") == function ]]; then
for OPTION in $(editions_"${OS}"); do
if [[ ${EDITIONS} ]]; then
for OPTION in ${EDITIONS}; do
echo "${DISPLAY_NAME},${OS},${RELEASE},${OPTION},${DOWNLOADER},${PNG},${SVG}"
done
elif [[ "${OS}" == "windows"* ]]; then