mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-11 02:11:01 +01:00
Avoid blank config.json
https://github.com/alexbelgium/hassio-addons/issues/1615
This commit is contained in:
@@ -273,7 +273,11 @@ for f in */; do
|
||||
# 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
|
||||
if [ -f /data/"${BASENAME}"/"${SLUG}"/config.json ]; then
|
||||
jq --arg variable "$LASTVERSION" '.version = $variable' /data/"${BASENAME}"/"${SLUG}"/config.json | sponge /data/"${BASENAME}"/"${SLUG}"/config.json # Replace version tag
|
||||
elif [ -f /data/"${BASENAME}"/"${SLUG}"/config.yaml ]; then
|
||||
sed -i "/version:/c\version: \"$LASTVERSION\"" /data/"${BASENAME}"/"${SLUG}"/config.yaml
|
||||
fi
|
||||
jq --arg variable "$LASTVERSION" '.upstream_version = $variable' /data/"${BASENAME}"/"${SLUG}"/updater.json | sponge /data/"${BASENAME}"/"${SLUG}"/updater.json # Replace upstream tag
|
||||
jq --arg variable "$DATE" '.last_update = $variable' /data/"${BASENAME}"/"${SLUG}"/updater.json | sponge /data/"${BASENAME}"/"${SLUG}"/updater.json # Replace date tag
|
||||
|
||||
|
||||
Reference in New Issue
Block a user