From cb4d27198fd1d72b16aaac079807a04cd378b9ba Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Fri, 12 Jan 2024 20:09:14 +0100 Subject: [PATCH] Update 99-run.sh --- addons_updater/rootfs/etc/cont-init.d/99-run.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/addons_updater/rootfs/etc/cont-init.d/99-run.sh b/addons_updater/rootfs/etc/cont-init.d/99-run.sh index 400dbcc0e..34dc419ca 100755 --- a/addons_updater/rootfs/etc/cont-init.d/99-run.sh +++ b/addons_updater/rootfs/etc/cont-init.d/99-run.sh @@ -201,7 +201,7 @@ for f in */; do # If failure, checks if there is packages that could be used function test_packages () { - if [[ "$SOURCE" == "github" ]] && [[ ${LASTVERSION,,:-} == *"no release found"* ]]; then + if [[ "$SOURCE" == "github" ]] && [[ "$(lastversion "$UPSTREAM" $ARGUMENTS 2>&1 || true)" == *"No release found"* ]]; then # Is there a package echo "No version found, looking if packages available" last_packages="$(curl -s https://github.com/"$REPOSITORY"/packages | sed -n "s/.*\/container\/package\/\([^\"]*\).*/\1/p")" || true @@ -229,11 +229,13 @@ for f in */; do else # Continue to next continue - fi } + fi + } #Execute version search + LASTVERSION="" # shellcheck disable=SC2086 - LASTVERSION="$(lastversion "$UPSTREAM" $ARGUMENTS 2>&1 || test_packages)" + LASTVERSION="$(lastversion "$UPSTREAM" $ARGUMENTS || test_packages)" fi