ebd2a43f84
Porta da main la riscrittura completa di conversione/_pipeline/ (9 stadi PyMuPDF) e la suite tests/ senza modificare chunks/, step-8/, rag.py, ollama/, retrieve.py, config.py. requirements.txt: aggiunge PyMuPDF>=1.24.0 e pytest>=8.0, mantiene chromadb, rimuove opendataloader-pdf e pymupdf4llm. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
48 lines
1.1 KiB
Bash
Executable File
48 lines
1.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
cd "$SCRIPT_DIR"
|
|
|
|
STEM="${1:-}"
|
|
|
|
if [[ -n "$STEM" ]]; then
|
|
# ── Modalità singolo stem ─────────────────────────────────────────────
|
|
target="./$STEM"
|
|
if [[ ! -d "$target" ]]; then
|
|
echo "Errore: cartella '$STEM' non trovata in conversione/."
|
|
exit 1
|
|
fi
|
|
rm -rf "$target"
|
|
echo "Rimossa: conversione/$STEM/"
|
|
exit 0
|
|
fi
|
|
|
|
# ── Modalità batch: tutti gli output (escluse cartelle infrastruttura) ────
|
|
mapfile -t dirs < <(
|
|
find . -maxdepth 1 -mindepth 1 -type d \
|
|
! -name '_*' \
|
|
! -name '__*' \
|
|
| sort
|
|
)
|
|
|
|
if [[ ${#dirs[@]} -eq 0 ]]; then
|
|
echo "Nessuna cartella di output da cancellare."
|
|
exit 0
|
|
fi
|
|
|
|
echo "Cartelle che verranno cancellate:"
|
|
for d in "${dirs[@]}"; do
|
|
echo " $d"
|
|
done
|
|
|
|
read -r -p "Confermi? [s/N] " answer
|
|
[[ "$answer" =~ ^[sS]$ ]] || { echo "Annullato."; exit 0; }
|
|
|
|
for d in "${dirs[@]}"; do
|
|
rm -rf "$d"
|
|
echo "Rimossa: $d"
|
|
done
|
|
|
|
echo "Pulizia completata."
|