[FIXED] Corregir varios errores en cversadm_token.sh

- Corregir ruta para cargar mensajes con load_messages
- Usar menu_actions en lugar de dialog_input_menu para mayor compatibilidad
- Añadir variables head_exit y head_key_end necesarias para menus
- Agregar inicialización de variables head_000 y head_002 para el título
- Incluir llamada a display_text_header para mostrar el encabezado

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Mauro Rosero P. 2025-03-15 13:16:23 -05:00
parent 3c4f9a8827
commit 4e7500adca
Signed by: mrosero
GPG key ID: 83BD2A5F674B7E26

View file

@ -29,15 +29,17 @@ BIN_BASE="bin"
BIN_LIBS="lib"
BIN_MESG="msg"
# Definir head_error para uso en funciones
# Definir variables necesarias para uso en funciones
head_error="ERROR"
head_exit="Salir"
head_key_end="END"
# Importar bibliotecas necesarias
source "${BIN_HOME}/${BIN_BASE}/${BIN_LIBS}/base.lib"
source "${BIN_HOME}/${BIN_BASE}/${BIN_LIBS}/console.lib"
# Cargar mensajes en español
load_messages "${BIN_HOME}" "${BIN_MESG}" "es" "developers"
load_messages "${BIN_HOME}/${BIN_BASE}" "${BIN_MESG}" "es" "developers"
# Variables globales
title="MRDevs Tools"
@ -60,21 +62,23 @@ ensure_developers_dir() {
fi
}
# Función para seleccionar la plataforma de control de versiones
# Función para seleccionar la plataforma de control de versiones usando menu_actions
select_platform() {
# Crear opciones del menú utilizando un formato compatible con dialog_input_menu
local options="1 ${cvmsg_010} 2 ${cvmsg_011} 3 ${cvmsg_012}"
# Preparar opciones para menu_actions
local menu_options="1:${cvmsg_010}
2:${cvmsg_011}
3:${cvmsg_012}"
# Incrementar filas para evitar problemas de espacio
dialog_input_menu "${cvmsg_001}" "${cvmsg_002}" "$options" 15 70
# Usar menu_actions en lugar de dialog_input_menu
local selection=$(menu_actions "${cvmsg_002}" "$menu_options" 5)
# Verificar si hubo cancelación o error
if [ $codex -ne 0 ]; then
if [ "$selection" = "${head_key_end}" ]; then
return 1
fi
# Interpretar la selección
case $value in
case $selection in
1) echo "github" ;;
2) echo "gitlab" ;;
3) echo "forgejo" ;;
@ -137,6 +141,15 @@ main() {
check_sops_installed
ensure_developers_dir
# Asegurar que head_000 y head_002 estén definidos para el título
if [ -z "$head_000" ] || [ -z "$head_002" ]; then
head_000="MRDevs"
head_002="Tools"
fi
# Mostrar título inicial
display_text_header
# Seleccionar plataforma
platform=$(select_platform)
if [ $? -ne 0 ]; then