mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-11 18:31:02 +01:00
Update 99-run.sh
This commit is contained in:
@@ -28,27 +28,10 @@ if bashio::config.has_value 'gitapi'; then
|
||||
export GITHUB_API_TOKEN
|
||||
fi
|
||||
|
||||
LOGINFO="... parse addons" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
|
||||
|
||||
# Go through all folders, add to filters if not existing
|
||||
echo "go in folder"
|
||||
cd /data/hassio-addons || exit
|
||||
for f in *; do
|
||||
echo "folder $f"
|
||||
if [ -f "$f"/updater.json ]; then
|
||||
cd /
|
||||
SLUG=$f
|
||||
REPOSITORY=$(jq -r .repository /data/"$f"/updater.json)
|
||||
UPSTREAM=$(jq -r .upstream /data/"$f"/updater.json)
|
||||
BETA=$(jq -r .beta /data/"$f"/updater.json)
|
||||
FULLTAG=$(jq -r .github_fulltag /data/"$f"/updater.json)
|
||||
HAVINGASSET=$(jq -r .github_havingasset /data/"$f"/updater.json)
|
||||
SOURCE=$(jq -r .source /data/"$f"/updater.json)
|
||||
FILTER_TEXT=$(jq -r .github_tagfilter /data/"$f"/updater.json)
|
||||
BASENAME=$(basename "https://github.com/$REPOSITORY")
|
||||
DATE="$(date '+%d-%m-%Y')"
|
||||
|
||||
#Create or update local version
|
||||
REPOSITORY=$(bashio::config 'repository')
|
||||
BASENAME=$(basename "https://github.com/$REPOSITORY")
|
||||
|
||||
if [ ! -d "/data/$BASENAME" ]; then
|
||||
LOGINFO="... $SLUG : cloning ${REPOSITORY}" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
|
||||
cd /data/ || exit
|
||||
@@ -60,6 +43,24 @@ if [ -f "$f"/updater.json ]; then
|
||||
git pull --rebase &>/dev/null
|
||||
fi
|
||||
|
||||
LOGINFO="... parse addons" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
|
||||
|
||||
# Go through all folders, add to filters if not existing
|
||||
echo "go in folder"
|
||||
cd /data/$BASENAME || exit
|
||||
for f in *; do
|
||||
echo "folder $f"
|
||||
if [ -f "$f"/updater.json ]; then
|
||||
SLUG=$f
|
||||
|
||||
UPSTREAM=$(jq -r .upstream "$f"/updater.json)
|
||||
BETA=$(jq -r .beta "$f"/updater.json)
|
||||
FULLTAG=$(jq -r .github_fulltag "$f"/updater.json)
|
||||
HAVINGASSET=$(jq -r .github_havingasset "$f"/updater.json)
|
||||
SOURCE=$(jq -r .source "$f"/updater.json)
|
||||
FILTER_TEXT=$(jq -r .github_tagfilter "$f"/updater.json)
|
||||
DATE="$(date '+%d-%m-%Y')"
|
||||
|
||||
#Define the folder addon
|
||||
LOGINFO="... $SLUG : checking slug exists in repo" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
|
||||
cd /data/"${BASENAME}"/"${SLUG}" || { bashio::log.error "$SLUG addon not found in this repository. Exiting."; continue; }
|
||||
|
||||
Reference in New Issue
Block a user