Skip to content

Commit

Permalink
Don't unnecessarily fetch editions for each release
Browse files Browse the repository at this point in the history
  • Loading branch information
lj3954 committed Apr 20, 2024
1 parent 3509b1c commit 392ac1c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions quickget
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ function csv_data() {
fi

for OS in $(os_support); do
local EDITIONS=""
DISPLAY_NAME="$(pretty_name "${OS}")"

case ${OS} in
Expand All @@ -400,6 +401,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"
Expand All @@ -408,8 +413,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
Expand Down

0 comments on commit 392ac1c

Please sign in to comment.