mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-07-07 22:41:01 +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
|
export GITHUB_API_TOKEN
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#Create or update local version
|
#Create or update local version
|
||||||
REPOSITORY=$(bashio::config 'repository')
|
REPOSITORY=$(bashio::config 'repository')
|
||||||
BASENAME=$(basename "https://github.com/$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
|
LOGINFO="... cloning ${REPOSITORY}" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
|
||||||
cd /data/ || exit
|
cd /data/ || exit
|
||||||
git clone "https://github.com/${REPOSITORY}"
|
git clone "https://github.com/${REPOSITORY}"
|
||||||
else
|
else
|
||||||
LOGINFO="... updating ${REPOSITORY}" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
|
LOGINFO="... updating ${REPOSITORY}" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi
|
||||||
cd "/data/$BASENAME" || exit
|
cd "/data/$BASENAME" || exit
|
||||||
git pull --rebase &>/dev/null || git reset --hard &>/dev/null
|
git pull --rebase &>/dev/null || git reset --hard &>/dev/null
|
||||||
git pull --rebase &>/dev/null
|
git pull --rebase &>/dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
LOGINFO="... parse addons" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; 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
|
cd /data/"$BASENAME" || exit
|
||||||
for f in */; do
|
for f in */; do
|
||||||
|
|
||||||
if [ -f /data/"$BASENAME"/"$f"/updater.json ]; then
|
if [ -f /data/"$BASENAME"/"$f"/updater.json ]; then
|
||||||
SLUG=${f//\/}
|
SLUG=${f//\/}
|
||||||
|
|
||||||
# Rebase
|
# Rebase
|
||||||
@@ -204,7 +204,7 @@ if [ -f /data/"$BASENAME"/"$f"/updater.json ]; then
|
|||||||
else
|
else
|
||||||
bashio::log.green "... $SLUG is up-to-date ${CURRENT}"
|
bashio::log.green "... $SLUG is up-to-date ${CURRENT}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done || true # Continue even if issue
|
done || true # Continue even if issue
|
||||||
|
|
||||||
bashio::log.info "Addons update completed"
|
bashio::log.info "Addons update completed"
|
||||||
|
|||||||
Reference in New Issue
Block a user