#!/bin/bash

# Répertoire du plugin SVN
SVN_PATH="/Users/cedricchevillard/Desktop/plugins-wordpress/smart-dpe-svn"

# Aller dans le dossier SVN
cd "$SVN_PATH" || exit 1

# Ajouter tous les fichiers (même nouveaux) à l’index SVN
svn add --force * --auto-props --parents --depth infinity -q

# Demande un message de commit à l'utilisateur
echo "Message du commit :"
read -r COMMIT_MSG

# Commit dans le repo (trunk)
svn commit -m "$COMMIT_MSG"

# Demande le numéro de version stable (ex: 1.0.1)
echo "Numéro de version stable (ex: 1.0.1) :"
read -r VERSION

# Copier le trunk vers le tag correspondant
svn copy "^/trunk" "^/tags/$VERSION" -m "Création du tag $VERSION"
