Update run.sh

This commit is contained in:
Alexandre
2021-02-22 07:57:39 +01:00
committed by GitHub
parent a74cde04b2
commit dca4ab9124

View File

@@ -78,12 +78,16 @@ for addons in $(bashio::config "addon|keys"); do
#Change all instances of version
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" # Change all tags in all addon files
# Remove " and modify version
LASTVERSION=${LASTVERSION//\"}
CURRENT=${CURRENT//\"}
jq --arg variable $LASTVERSION '.version = $variable' /data/${BASENAME}/${SLUG}/config.json | sponge /data/${BASENAME}/${SLUG}/config.json # Replace version tag
#Update changelog
touch /data/${BASENAME}/${SLUG}/CHANGELOG.md
sed -i "1i\- Update to latest version from $UPSTREAM" /data/${BASENAME}/${SLUG}/CHANGELOG.md
sed -i "1i\## ${LASTVERSION:1:-1}" /data/${BASENAME}/${SLUG}/CHANGELOG.md
sed -i "1i\## ${LASTVERSION}" /data/${BASENAME}/${SLUG}/CHANGELOG.md
sed -i "1i\ " /data/${BASENAME}/${SLUG}/CHANGELOG.md
if [ $files != null ]; then