mirror of
https://github.com/MaksTinyWorkshop/_Assistant_Lead_Tech
synced 2026-04-06 21:41:42 +02:00
feat: automate project bootstrap and registry
This commit is contained in:
@@ -9,39 +9,16 @@ set -euo pipefail
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||
SOURCE="$REPO_ROOT/_AI_INSTRUCTIONS.md"
|
||||
PROJECTS_CONF="$REPO_ROOT/_projects.conf"
|
||||
|
||||
# --- Détection machine ---
|
||||
OS="$(uname -s)"
|
||||
CHANGED=0
|
||||
|
||||
# --- Construire la table markdown des projets ---
|
||||
build_projects_table() {
|
||||
local os="$1"
|
||||
echo "| Projet | Stack | Localisation | État |"
|
||||
echo "|---|---|---|---|"
|
||||
while IFS='|' read -r nom stack path_nuc path_mac etat; do
|
||||
# Ignorer lignes vides et commentaires
|
||||
[[ -z "$nom" || "$nom" == \#* ]] && continue
|
||||
if [ "$os" = "Darwin" ]; then
|
||||
path="$path_mac"
|
||||
else
|
||||
path="$path_nuc"
|
||||
fi
|
||||
if [ -z "$path" ]; then
|
||||
echo "| $nom | $stack | *non disponible sur cette machine* | $etat |"
|
||||
else
|
||||
echo "| $nom | $stack | \`$path\` | $etat |"
|
||||
fi
|
||||
done < "$PROJECTS_CONF"
|
||||
}
|
||||
|
||||
generate_repo_claude() {
|
||||
local header="$1"
|
||||
local dest="$2"
|
||||
local projects_table
|
||||
local tmp
|
||||
projects_table="$(build_projects_table "$OS")"
|
||||
|
||||
tmp="$(mktemp)"
|
||||
|
||||
mkdir -p "$(dirname "$dest")"
|
||||
@@ -49,14 +26,7 @@ generate_repo_claude() {
|
||||
{
|
||||
echo "$header"
|
||||
echo ""
|
||||
# Remplacer {{PROJECTS_TABLE}} par la table générée
|
||||
while IFS= read -r line; do
|
||||
if [ "$line" = "{{PROJECTS_TABLE}}" ]; then
|
||||
echo "$projects_table"
|
||||
else
|
||||
echo "$line"
|
||||
fi
|
||||
done < "$SOURCE"
|
||||
cat "$SOURCE"
|
||||
} > "$tmp"
|
||||
|
||||
if [ ! -f "$dest" ] || ! cmp -s "$tmp" "$dest"; then
|
||||
|
||||
Reference in New Issue
Block a user