Actualiser cookcli/rootfs/etc/services.d/git-sync/run

This commit is contained in:
TheThomaas 2026-09-06 07:58:36 +00:00
parent b74c7f2e0a
commit e8d10cfe25

View file

@ -12,7 +12,7 @@ sync_git() {
bashio::log.info "=== Service de synchronisation Git 5 ===" bashio::log.info "=== Service de synchronisation Git 5 ==="
local PASSWORD=$(bashio::config 'git_password') local PASSWORD=$(bashio::config 'git_password')
bashio::log.info "=== Service de synchronisation Git 6 ===" bashio::log.info "=== Service de synchronisation Git 6 ==="
local PATH=$(bashio::config 'recipes_path') local RECIPES_PATH=$(bashio::config 'recipes_path')
bashio::log.info "=== Service de synchronisation Git 7 ===" bashio::log.info "=== Service de synchronisation Git 7 ==="
if [ -z "$REPO" ]; then if [ -z "$REPO" ]; then
@ -37,10 +37,10 @@ sync_git() {
# Clone ou pull # Clone ou pull
if [ ! -d "$PATH/.git" ]; then if [ ! -d "$PATH/.git" ]; then
bashio::log.info "Premier clone du dépôt..." bashio::log.info "Premier clone du dépôt..."
git clone --branch "$BRANCH" "$AUTH_URL" "$PATH" 2>&1 | bashio::log.info git clone --branch "$BRANCH" "$AUTH_URL" "$RECIPES_PATH" 2>&1 | bashio::log.info
else else
bashio::log.info "Mise à jour du dépôt existant..." bashio::log.info "Mise à jour du dépôt existant..."
cd "$PATH" cd "$RECIPES_PATH"
# Réinitialisation pour éviter les conflits # Réinitialisation pour éviter les conflits
git fetch origin "$BRANCH" 2>&1 | bashio::log.info git fetch origin "$BRANCH" 2>&1 | bashio::log.info
git reset --hard "origin/$BRANCH" 2>&1 | bashio::log.info git reset --hard "origin/$BRANCH" 2>&1 | bashio::log.info