From 31834d4bed51200f34f3ffe0d557f6cbf64a14dc Mon Sep 17 00:00:00 2001 From: "Mauro Rosero P." Date: Sun, 30 Mar 2025 15:46:10 -0500 Subject: [PATCH] [FIXED] Corregir rutas en scripts bootstrap.sh y update.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Corrección de rutas para que los scripts utilicen SCRIPT_DIR en lugar de BIN_HOME para resolver problemas al cargar bibliotecas y configuraciones. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- bin/bootstrap.sh | 10 +++++----- bin/update.sh | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/bin/bootstrap.sh b/bin/bootstrap.sh index 413e394..705fd8f 100755 --- a/bin/bootstrap.sh +++ b/bin/bootstrap.sh @@ -40,16 +40,16 @@ BIN_BASE="bin" BIN_LIBS="lib" BIN_MESG="msg" BIN_CFGS="config" -VERSION=$(cat "$BIN_HOME/$BIN_BASE/$BIN_CFGS/version") +VERSION=$(cat "$SCRIPT_DIR/$BIN_CFGS/version") # CHECK SHELL LANGUAGE BIN_LANG=${LANG:0:2} # Importar bibliotecas necesarias -source "${BIN_HOME}/${BIN_BASE}/${BIN_LIBS}/base.lib" +source "${SCRIPT_DIR}/${BIN_LIBS}/base.lib" # Cargar mensajes en el idioma del sistema o español por defecto -load_messages "${BIN_HOME}/${BIN_BASE}" "${BIN_MESG}" "${BIN_LANG}" "head" +load_messages "${SCRIPT_DIR}" "${BIN_MESG}" "${BIN_LANG}" "head" # Variables globales title="${head_000} ${head_002}" @@ -215,10 +215,10 @@ install() { } # Load messages -load_bootstrap_msg $BIN_HOME $BIN_MESG $BIN_LANG +load_bootstrap_msg $SCRIPT_DIR $BIN_MESG $BIN_LANG # Display Headers display_devstools_header "- $bomsg_000" # Run install with sudo (sin parámetros específicos) -sudo bash -c "$(declare -f load_bootstrap_msg; declare -f install); install $BIN_HOME $BIN_LIBS $BIN_MESG $BIN_LANG" +sudo bash -c "$(declare -f load_bootstrap_msg; declare -f install); install $SCRIPT_DIR $BIN_LIBS $BIN_MESG $BIN_LANG" diff --git a/bin/update.sh b/bin/update.sh index 4c1d081..f2c209d 100755 --- a/bin/update.sh +++ b/bin/update.sh @@ -40,10 +40,10 @@ BIN_BASE="bin" BIN_LIBS="lib" BIN_MESG="msg" BIN_CFGS="config" -VERSION=$(cat "$BIN_HOME/$BIN_BASE/$BIN_CFGS/version") +VERSION=$(cat "$SCRIPT_DIR/$BIN_CFGS/version") # LOAD BASE BASH LIBRARY -source $BIN_HOME/$BIN_BASE/$BIN_LIBS/base.lib +source $SCRIPT_DIR/$BIN_LIBS/base.lib #baselib_test load_bootstrap_msg() { @@ -61,7 +61,7 @@ load_bootstrap_msg() { } # Load messages -load_bootstrap_msg $BIN_HOME $BIN_MESG $BIN_LANG +load_bootstrap_msg $SCRIPT_DIR $BIN_MESG $BIN_LANG # Display Headers display_devstools_header "- $bomsg_001" @@ -76,7 +76,7 @@ else fi # Load bootstrap library for update functions -source $BIN_HOME/$BIN_BASE/$BIN_LIBS/bootstrap.lib +source $SCRIPT_DIR/$BIN_LIBS/bootstrap.lib # Update sistema operativo y repositorios primero (no requiere privilegios de root) echo -e "\n${head_info}: Actualizando repositorios locales primero..." @@ -190,7 +190,7 @@ if [ $PYTHON_INSTALLED -eq 0 ] || [ $PIP_INSTALLED -eq 0 ]; then # Exportar todas las funciones necesarias para que estén disponibles en el subproceso sudo # Esto incluye command_installed y otras funciones de base.lib que se necesitan - sudo bash -c "$(declare -f command_installed; declare -f update_python_and_pip); update_python_and_pip $BIN_HOME $BIN_LIBS $BIN_MESG $BIN_LANG" + sudo bash -c "$(declare -f command_installed; declare -f update_python_and_pip); update_python_and_pip $SCRIPT_DIR $BIN_LIBS $BIN_MESG $BIN_LANG" if [ $? -ne 0 ]; then echo -e "\n${head_error}: No se pudo actualizar Python y pip. Verifique sus privilegios." fi @@ -207,7 +207,7 @@ update_additional_tools() { local UPDATE_LANG=$4 # Cargar biblioteca bootstrap para acceder a las funciones de instalación - source "$BIN_PATH/$BIN_BASE/$LIBRARY/bootstrap.lib" + source "$BIN_PATH/$LIBRARY/bootstrap.lib" # Actualizar oathtool si está instalado command_installed oathtool @@ -251,7 +251,7 @@ update_additional_tools() { # Actualizar herramientas adicionales con sudo si están instaladas 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_BASE $BIN_LIBS $BIN_MESG $BIN_LANG" +sudo bash -c "$(declare -f command_installed; declare -f update_additional_tools); update_additional_tools $SCRIPT_DIR $BIN_LIBS $BIN_MESG $BIN_LANG" echo -e "\n${head_info}: Proceso de actualización completado."