From afcec3662d3cee739891a46b8f0b025a2de281c5 Mon Sep 17 00:00:00 2001 From: Michel Date: Sun, 20 Apr 2025 10:49:17 +0200 Subject: [PATCH] =?UTF-8?q?Ajout=20script=20de=20mise=20=C3=A0=20jour=20pr?= =?UTF-8?q?oduct=20depuis=20develop?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Docs/Commandes pratiques terminal | 0 tools/update_product_from_develop.sh | 33 ++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 Docs/Commandes pratiques terminal create mode 100644 tools/update_product_from_develop.sh diff --git a/Docs/Commandes pratiques terminal b/Docs/Commandes pratiques terminal new file mode 100644 index 0000000..e69de29 diff --git a/tools/update_product_from_develop.sh b/tools/update_product_from_develop.sh new file mode 100644 index 0000000..c4d19b2 --- /dev/null +++ b/tools/update_product_from_develop.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +# --------------------------------------------- +# Script : update_product_from_develop.sh +# Objectif : Met à jour les fichiers de 'product' depuis 'develop' +# uniquement pour les fichiers déjà existants dans product +# --------------------------------------------- + +echo "📁 Branche active : $(git branch --show-current)" + +# Vérification qu'on est bien sur 'product' +current_branch=$(git branch --show-current) +if [ "$current_branch" != "product" ]; then + echo "❌ Tu n'es pas sur la branche 'product'. Abandon." + exit 1 +fi + +# Lister les fichiers présents dans 'product' +echo "📄 Création de la liste des fichiers dans 'product'..." +git ls-tree --name-only -r product > product_files.txt + +echo "🔄 Mise à jour des fichiers depuis 'develop'..." + +while IFS= read -r file; do + if git show develop:"$file" > /dev/null 2>&1; then + git checkout develop -- "$file" + echo "✅ Mis à jour : $file" + else + echo "❌ Absent dans develop : $file" + fi +done < product_files.txt + +echo "✅ Mise à jour terminée."