[IMPROVED] Simplificar update.sh y eliminar parámetros específicos para herramientas

- Quitar parámetros específicos --oathtool y --zbar del script update.sh
- Simplificar la función update_additional_tools eliminando parámetros opcionales
- Actualizar automáticamente oathtool y zbar si están instalados
- Eliminar procesamiento de argumentos redundante
- Actualizar README para reflejar la nueva funcionalidad simplificada

🤖 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 19:08:18 -05:00
parent 60d0d3337d
commit 12495ab53e
Signed by: mrosero
GPG key ID: 83BD2A5F674B7E26
2 changed files with 2 additions and 49 deletions

View file

@ -39,9 +39,7 @@ bin/update.sh
| Comando | Descripción | | Comando | Descripción |
|---------|-------------| |---------|-------------|
| `bin/bootstrap.sh` | Instala herramientas básicas (incluyendo oathtool y zbar) y configura la gestión de contenedores | | `bin/bootstrap.sh` | Instala herramientas básicas (incluyendo oathtool y zbar) y configura la gestión de contenedores |
| `bin/update.sh` | Actualiza el entorno de desarrollo con las últimas funcionalidades | | `bin/update.sh` | Actualiza el entorno de desarrollo y herramientas (incluyendo oathtool y zbar) |
| `bin/update.sh --oathtool` | Actualiza únicamente oathtool (herramienta para TOTP/HOTP) |
| `bin/update.sh --zbar` | Actualiza únicamente zbar (herramienta para lectura de códigos QR) |
| `bin/npm_install.sh` | Instala NodeJS y npm de forma interactiva | | `bin/npm_install.sh` | Instala NodeJS y npm de forma interactiva |
| `bin/project_new.sh` | Crea un nuevo proyecto con estructura estandarizada según el tipo seleccionado | | `bin/project_new.sh` | Crea un nuevo proyecto con estructura estandarizada según el tipo seleccionado |

View file

@ -188,41 +188,10 @@ update_additional_tools() {
local LIBRARY=$2 local LIBRARY=$2
local MESSAGES=$3 local MESSAGES=$3
local UPDATE_LANG=$4 local UPDATE_LANG=$4
local SPECIFIC_TOOL=$5 # Herramienta específica a actualizar (opcional)
# Cargar biblioteca bootstrap para acceder a las funciones de instalación # Cargar biblioteca bootstrap para acceder a las funciones de instalación
source "$BIN_PATH/$LIBRARY/bootstrap.lib" source "$BIN_PATH/$LIBRARY/bootstrap.lib"
if [[ -n "$SPECIFIC_TOOL" ]]; then
# Actualizar solo la herramienta especificada
case "$SPECIFIC_TOOL" in
"oathtool")
echo -e "\n${head_info}: Actualizando oathtool..."
command_installed oathtool
if [ $? -eq 0 ]; then
oathtool_install
echo -e "${head_info}: oathtool actualizado correctamente."
else
echo -e "${head_info}: oathtool no está instalado. Para instalarlo, ejecute: bin/bootstrap.sh --oathtool"
fi
;;
"zbar")
echo -e "\n${head_info}: Actualizando zbar..."
command_installed zbar-tools
if [ $? -eq 0 ]; then
zbar_install
echo -e "${head_info}: zbar actualizado correctamente."
else
echo -e "${head_info}: zbar no está instalado. Para instalarlo, ejecute: bin/bootstrap.sh --zbar"
fi
;;
*)
echo -e "\n${head_error}: Herramienta '$SPECIFIC_TOOL' no reconocida."
;;
esac
return
fi
# Actualizar oathtool si está instalado # Actualizar oathtool si está instalado
command_installed oathtool command_installed oathtool
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
@ -240,23 +209,9 @@ update_additional_tools() {
fi fi
} }
# Procesar argumentos
TOOL_TO_UPDATE=""
if [ $# -ge 1 ]; then
case "$1" in
"--oathtool")
TOOL_TO_UPDATE="oathtool"
;;
"--zbar")
TOOL_TO_UPDATE="zbar"
;;
esac
fi
# Actualizar herramientas adicionales con sudo si están instaladas # Actualizar herramientas adicionales con sudo si están instaladas
echo -e "\n${head_info}: Verificando herramientas adicionales..." echo -e "\n${head_info}: Verificando herramientas adicionales..."
sudo bash -c "$(declare -f command_installed; declare -f update_additional_tools); update_additional_tools $BIN_HOME $BIN_LIBS $BIN_MESG $BIN_LANG '$TOOL_TO_UPDATE'" sudo bash -c "$(declare -f command_installed; declare -f update_additional_tools); update_additional_tools $BIN_HOME $BIN_LIBS $BIN_MESG $BIN_LANG"
echo -e "\n${head_info}: Proceso de actualización completado." echo -e "\n${head_info}: Proceso de actualización completado."