#!/usr/bin/env bash # Script para generar index.html en cada carpeta de manera recursiva # Exluye: .git, node_modules, .venv, __pycache__, .env, dist, build # Uso: ./generar_indices.sh [directorio_raiz] ROOT="${1:-.}" # Directorios a excluir EXCLUDE_DIRS=(.git node_modules .venv __pycache__ .env dist build .next .cache) # Construir opciones de find para excluir FIND_EXCLUDES="" for dir in "${EXCLUDE_DIRS[@]}"; do FIND_EXCLUDES+="-not -path '*/$dir' -not -path '*/$dir/*' " done # Encuentra directorios, excluyendo los especificados find "$ROOT" -type d $FIND_EXCLUDES | while read -r dir; do echo "Generando índice en: $dir" { echo "" echo "