From 2bbb6d749329b187a00c94592fff3aa0902a0777 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Thu, 11 Jan 2024 13:56:59 +0100 Subject: [PATCH] ongoing --- .../rootfs/etc/cont-init.d/99-run.sh | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 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 88e48894b..2840b6e59 100755 --- a/addons_updater/rootfs/etc/cont-init.d/99-run.sh +++ b/addons_updater/rootfs/etc/cont-init.d/99-run.sh @@ -200,9 +200,29 @@ for f in */; do #Execute version search # shellcheck disable=SC2086 - LASTVERSION=$(lastversion "$UPSTREAM" $ARGUMENTS) || continue - fi + LASTVERSION="$(lastversion "$UPSTREAM" $ARGUMENTS 2>&1)" || \ + \ + # check if it is an issue with no releases in github + ( if [[ "$SOURCE" == "github" ]] && [[ ${LASTVERSION,,} == *"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")" + last_package="$(echo "$last_packages" | head -n 1)" + if [[ "$(echo -n "$last_packages" | grep -c '^')" -gt 0 ]]; then + echo "A total of $(echo -n "$last_packages" | grep -c '^') packages were found, using $last_package" + else + echo "No packages found" + # Continue to next + continue + fi + + # Are there tags + + else + # Continue to next + continue + fi ) # Add brackets LASTVERSION='"'${LASTVERSION}'"'