#!/usr/bin/env bash # ----------------------------------------------------------------------------- # ObsiGate — installe les hooks git versionnés (.githooks). # # 1. `core.hooksPath = .githooks` -> hooks partagés par tout le monde (versionnés) # 2. `push.followTags = true` -> le tag de version créé au commit est publié # automatiquement à chaque `git push` # # À exécuter une fois par clone : scripts/install-hooks.sh # ----------------------------------------------------------------------------- set -euo pipefail root="$(git rev-parse --show-toplevel)" cd "$root" if [ ! -d .githooks ]; then echo "✗ Dossier .githooks introuvable." >&2 exit 1 fi git config core.hooksPath .githooks git config push.followTags true chmod +x .githooks/* 2>/dev/null || true echo "✓ Hooks installés :" echo " core.hooksPath = $(git config --get core.hooksPath)" echo " push.followTags = $(git config --get push.followTags)" echo " → La version (./VERSION) est incrémentée à chaque commit et taguée" echo " (vX.Y.Z), puis publiée avec la branche à chaque push."