From c4399fe6af40100667d2f5b1bf119c4caa6b4dc3 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Wed, 17 Feb 2021 07:26:46 +0100 Subject: [PATCH] Allow custom additions to current flag --- addons_updater/run.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/addons_updater/run.sh b/addons_updater/run.sh index 66a3e8ae9..8c57c46d2 100644 --- a/addons_updater/run.sh +++ b/addons_updater/run.sh @@ -62,12 +62,20 @@ fi #If beta flag, select beta version if [ ${BETA} = true ]; then LOGINFO="... $SLUG : beta is on" && if [ $VERBOSE = true ]; then bashio::log.info $LOGINFO; fi - LASTVERSION='"'$(lastversion --pre "https://github.com/$UPSTREAM" $FULLTAG)'"' + LASTVERSION=$(lastversion --pre "https://github.com/$UPSTREAM" $FULLTAG) else LOGINFO="... $SLUG : beta is off" && if [ $VERBOSE = true ]; then bashio::log.info $LOGINFO; fi - LASTVERSION='"'$(lastversion "https://github.com/$UPSTREAM" $FULLTAG)'"' + LASTVERSION=$(lastversion "https://github.com/$UPSTREAM" $FULLTAG) fi + # Take only into account first part of tag + CURRENT=${CURRENT:0:${#LASTVERSION}} + + # Add brackets + CURRENT='"'$CURRENT'"' + LASTVERSION='"'$LASTVERSION'"' + + # Update if needed if [ ${CURRENT} != ${LASTVERSION} ]; then LOGINFO="... $SLUG : update from $CURRENT to $LASTVERSION" && if [ $VERBOSE = true ]; then bashio::log.info $LOGINFO; fi