-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.sh
More file actions
executable file
·38 lines (30 loc) · 1.93 KB
/
Copy pathinit.sh
File metadata and controls
executable file
·38 lines (30 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env bash
# init.sh — project-churn-analysis (Python, Data Science)
set -euo pipefail
PASS=0; FAIL=0
green() { echo -e "\033[32m✓ $1\033[0m"; }
red() { echo -e "\033[31m✗ $1\033[0m"; }
warn() { echo -e "\033[33m⚠ $1\033[0m"; }
info() { echo -e "\033[36m→ $1\033[0m"; }
check() { local l="$1"; shift; if "$@" &>/dev/null; then green "$l"; PASS=$((PASS + 1)); else red "$l"; FAIL=$((FAIL + 1)); fi; }
echo ""; info "project-churn-analysis — verificación pre-sesión"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""; info "Estructura"
check "churn_analysis.py existe" test -f "churn_analysis.py"
check "README.md existe" test -f "README.md"
check "CLAUDE.md en .gitignore" grep -q "CLAUDE.md" ".gitignore"
[ ! -d ".claude/progress" ] && mkdir -p ".claude/progress" && warn ".claude/progress creado" || { green ".claude/progress existe"; PASS=$((PASS + 1)); }
echo ""; info "Python — librerías data science"
check "pandas disponible" python3 -c "import pandas"
check "numpy disponible" python3 -c "import numpy"
check "sklearn disponible" python3 -c "import sklearn"
check "matplotlib disponible" python3 -c "import matplotlib"
echo ""; info "Sintaxis"
check "churn_analysis.py" python3 -m py_compile churn_analysis.py
check "generate_data.py" python3 -m py_compile generate_data.py
echo ""; info "Git"
UNCOMMITTED=$(git status --porcelain 2>/dev/null | wc -l | tr -d ' ')
[ "$UNCOMMITTED" -gt 0 ] && warn "$UNCOMMITTED archivo(s) sin commit" || { green "Working tree limpio"; PASS=$((PASS + 1)); }
echo ""; echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "Resultado: $PASS ✓ $FAIL ✗"
[ "$FAIL" -gt 0 ] && { red "PROYECTO EN MAL ESTADO — Resuelve los errores antes de continuar"; exit 1; } || { green "Proyecto verificado — puedes empezar"; exit 0; }