Allow multiple sources

This commit is contained in:
Alexandre
2022-04-27 14:07:29 +02:00
committed by GitHub
parent 5c3ff9b0f5
commit ff2ccb4a0a

View File

@@ -76,7 +76,7 @@ if [ -f /data/"$BASENAME"/"$f"/updater.json ]; then
LOGINFO="... $SLUG : get current version" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
CURRENT=$(jq .upstream_version updater.json) || { bashio::log.error "$SLUG addon upstream tag not found in updater.json. Exiting."; continue; }
if [ "$SOURCE" = "dockerhub" ]; then
if [[ "$SOURCE" = dockerhub ]]; then
# Use dockerhub as upstream
# shellcheck disable=SC2116
DOCKERHUB_REPO=$(echo "${UPSTREAM%%/*}")
@@ -98,10 +98,11 @@ if [ -f /data/"$BASENAME"/"$f"/updater.json ]; then
sort -V |
tail -n 1
)
else
# Use github as upstream
ARGUMENTS=""
# Use source as upstream
ARGUMENTS="--at $SOURCE"
#Prepare tag flag
if [ "${FULLTAG}" = true ]; then
LOGINFO="... $SLUG : fulltag is on" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
@@ -130,14 +131,14 @@ if [ -f /data/"$BASENAME"/"$f"/updater.json ]; then
if [ "${BETA}" = true ]; then
LOGINFO="... $SLUG : beta is on" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
# shellcheck disable=SC2086
LASTVERSION=$(lastversion --pre "https://github.com/$UPSTREAM" $ARGUMENTS) || continue
LASTVERSION=$(lastversion --pre "$UPSTREAM" $ARGUMENTS) || continue
else
LOGINFO="... $SLUG : beta is off" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
# shellcheck disable=SC2086
LASTVERSION=$(lastversion "https://github.com/$UPSTREAM" $ARGUMENTS) || continue
LASTVERSION=$(lastversion "$UPSTREAM" $ARGUMENTS) || continue
fi
fi
fi
# Add brackets
LASTVERSION='"'${LASTVERSION}'"'