mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-07-28 08:50:32 +02:00
change tag update from version to upstream
This commit is contained in:
@@ -48,7 +48,7 @@ for addons in $(bashio::config "addon|keys"); do
|
|||||||
|
|
||||||
#Find current version
|
#Find current version
|
||||||
LOGINFO="... $SLUG : get current version" && if [ $VERBOSE = true ]; then bashio::log.info $LOGINFO; fi
|
LOGINFO="... $SLUG : get current version" && if [ $VERBOSE = true ]; then bashio::log.info $LOGINFO; fi
|
||||||
CURRENT=$(jq .version config.json) || bashio::log.error "$SLUG addon version in config.json not found. Exiting." exit
|
CURRENT=$(jq .upstream config.json) || bashio::log.error "$SLUG addon upstream tag not found in config.json. Exiting." exit
|
||||||
|
|
||||||
#Prepare tag flag
|
#Prepare tag flag
|
||||||
if [ ${FULLTAG} = true ]; then
|
if [ ${FULLTAG} = true ]; then
|
||||||
@@ -68,9 +68,6 @@ fi
|
|||||||
LASTVERSION=$(lastversion "https://github.com/$UPSTREAM" $FULLTAG)
|
LASTVERSION=$(lastversion "https://github.com/$UPSTREAM" $FULLTAG)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Take only into account first part of tag
|
|
||||||
# CURRENT=${CURRENT:0:${#LASTVERSION}}
|
|
||||||
|
|
||||||
# Add brackets
|
# Add brackets
|
||||||
LASTVERSION='"'$LASTVERSION'"'
|
LASTVERSION='"'$LASTVERSION'"'
|
||||||
|
|
||||||
@@ -80,7 +77,8 @@ fi
|
|||||||
|
|
||||||
#Change all instances of version
|
#Change all instances of version
|
||||||
LOGINFO="... $SLUG : updating files" && if [ $VERBOSE = true ]; then bashio::log.info $LOGINFO; fi
|
LOGINFO="... $SLUG : updating files" && if [ $VERBOSE = true ]; then bashio::log.info $LOGINFO; fi
|
||||||
files=$(grep -rl ${CURRENT} /data/${BASENAME}/${SLUG}) && echo $files | xargs sed -i "s/${CURRENT}/${LASTVERSION}/g"
|
files=$(grep -rl ${CURRENT} /data/${BASENAME}/${SLUG}) && echo $files | xargs sed -i "s/${CURRENT}/${LASTVERSION}/g" # change all tags in all addon files
|
||||||
|
jq --arg LASTVERSION "$LASTVERSION" '.upstream = $LASTVERSION' /data/${BASENAME}/${SLUG}/config.json # Correct config upstream
|
||||||
|
|
||||||
#Update changelog
|
#Update changelog
|
||||||
touch /data/${BASENAME}/${SLUG}/CHANGELOG.md
|
touch /data/${BASENAME}/${SLUG}/CHANGELOG.md
|
||||||
|
|||||||
Reference in New Issue
Block a user