feat: menu CLI minimalista (pure-bash, cero dependencias)

- core/menu.sh: show_menu() con navegacion ANSI pura (read -sn1 + clear via printf ANSI), flechas up/down + Enter, atajo numerico 1-5/0, q/ESC salir, guard EOF
- main.sh: menu como entrada por defecto (los flags --yes/--no-gpu la bypassan); despacho sin logica de negocio (MODE: full/neo/openvino + subcomandos doctor/uninstall)
- Control de flujo: MODE!=openvino salta NEO; MODE=neo finaliza tras NEO (sin abrir OpenVINO)
- Verificado: tecla 4 -> doctor completo, q/ESC/EOF -> salida limpia, opcion 2 sin root -> error de privilegios
This commit is contained in:
stornic56
2026-09-29 12:05:17 -05:00
parent 09de89f31e
commit 5c82b320fd
2 changed files with 95 additions and 1 deletions
+33 -1
View File
@@ -53,6 +53,33 @@ while [ $# -gt 0 ]; do
shift
done
# Menu (Pure-bash ANSI, cero dependencias): la entrada por defecto; los flags la bypassan
MODE="full"
if [ "$ASSUME_YES" != true ] && [ "$FORCE_NO_GPU" != true ]; then
source "$CORE_DIR/menu.sh"
sel=0
show_menu || sel=$?
case "$sel" in
0)
print_step "Hasta pronto."
exit 0
;;
1) : ;;
2) MODE="neo" ;;
3) MODE="openvino" ;;
4)
source "$CORE_DIR/doctor.sh"
run_doctor_checks
exit 0
;;
5)
source "$CORE_DIR/uninstall.sh"
run_uninstall
exit 0
;;
esac
fi
# privileges
if [ "$EUID" -ne 0 ]; then
echo "ERROR: This script must be run as root. Use:"
@@ -141,7 +168,7 @@ fi
# ------------------------------------------------------------------------------
# 3. Install NEO (only if there is a GPU)
# ------------------------------------------------------------------------------
if [ "$GPU_PRESENT" = true ]; then
if [ "$MODE" != "openvino" ] && [ "$GPU_PRESENT" = true ]; then
print_step "3. Installing GPU drivers (Intel Compute Runtime NEO)..."
case "$OS_ID" in
debian)
@@ -158,6 +185,11 @@ else
print_step "3. Skipping NEO driver installation (no Intel GPU)."
fi
if [ "$MODE" = "neo" ]; then
print_step "Instalacion NEO finalizada."
exit 0
fi
# ------------------------------------------------------------------------------
# 4. Download OpenVINO Runtime
# ------------------------------------------------------------------------------