mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-07-13 17:40:31 +02:00
Github bot : script beautyshied
This commit is contained in:
@@ -28,20 +28,20 @@ if bashio::config.has_value 'gitapi'; then
|
||||
export GITHUB_API_TOKEN
|
||||
fi
|
||||
|
||||
#Create or update local version
|
||||
REPOSITORY=$(bashio::config 'repository')
|
||||
BASENAME=$(basename "https://github.com/$REPOSITORY")
|
||||
#Create or update local version
|
||||
REPOSITORY=$(bashio::config 'repository')
|
||||
BASENAME=$(basename "https://github.com/$REPOSITORY")
|
||||
|
||||
if [ ! -d "/data/$BASENAME" ]; then
|
||||
if [ ! -d "/data/$BASENAME" ]; then
|
||||
LOGINFO="... cloning ${REPOSITORY}" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
|
||||
cd /data/ || exit
|
||||
git clone "https://github.com/${REPOSITORY}"
|
||||
else
|
||||
else
|
||||
LOGINFO="... updating ${REPOSITORY}" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
|
||||
cd "/data/$BASENAME" || exit
|
||||
git pull --rebase &>/dev/null || git reset --hard &>/dev/null
|
||||
git pull --rebase &>/dev/null
|
||||
fi
|
||||
fi
|
||||
|
||||
LOGINFO="... parse addons" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
|
||||
|
||||
@@ -50,7 +50,7 @@ LOGINFO="... parse addons" && if [ "$VERBOSE" = true ]; then bashio::log.info "$
|
||||
cd /data/"$BASENAME" || exit
|
||||
for f in */; do
|
||||
|
||||
if [ -f /data/"$BASENAME"/"$f"/updater.json ]; then
|
||||
if [ -f /data/"$BASENAME"/"$f"/updater.json ]; then
|
||||
SLUG=${f//\/}
|
||||
|
||||
# Rebase
|
||||
@@ -204,7 +204,7 @@ if [ -f /data/"$BASENAME"/"$f"/updater.json ]; then
|
||||
else
|
||||
bashio::log.green "... $SLUG is up-to-date ${CURRENT}"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done || true # Continue even if issue
|
||||
|
||||
bashio::log.info "Addons update completed"
|
||||
|
||||
Reference in New Issue
Block a user