From f1ebc0c505f65ec035e32181989bfaeae88c9dbd Mon Sep 17 00:00:00 2001 From: Liam <33645555+lj3954@users.noreply.github.com> Date: Sat, 20 Apr 2024 16:52:04 -0700 Subject: [PATCH] Don't unnecessarily fetch editions for each release --- quickget | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/quickget b/quickget index 51e615f..3c53aad 100755 --- a/quickget +++ b/quickget @@ -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