diff --git a/bin/bootstrap.sh b/bin/bootstrap.sh index 5b3ff2b..e633c23 100755 --- a/bin/bootstrap.sh +++ b/bin/bootstrap.sh @@ -127,6 +127,13 @@ install() { then python3_install fi + + # Verificar si pip está instalado, instalarlo si es necesario + command_installed pip3 + if [ $? -ne 0 ] + then + pip_install + fi # Install mozilla sops from OS Packages command_installed $SOPS_PACKAGE diff --git a/bin/lib/bootstrap.lib b/bin/lib/bootstrap.lib index eb0fec2..257ffd5 100755 --- a/bin/lib/bootstrap.lib +++ b/bin/lib/bootstrap.lib @@ -100,20 +100,20 @@ function python3_install() { if [ "$(uname)" == "Darwin" ]; then # En macOS, instalamos o actualizamos Python a través de Homebrew /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - brew install python python-pip + brew install python elif [ -f /etc/debian_version ] || [ -f /etc/os-release ]; then # En sistemas Debian y derivados, instalamos o actualizamos Python a través de apt apt update - apt install -y python3 python3-pip + apt install -y python3 elif [ -f /etc/redhat-release ]; then # En sistemas Red Hat, instalamos o actualizamos Python a través de yum - dnf install -y python3 python3-pip + dnf install -y python3 elif [ -f /etc/arch-release ]; then # En Arch Linux, instalamos o actualizamos Python a través de pacman pacman -Sy --noconfirm python elif [ -f /etc/rc.conf ]; then # En BSD, instalamos o actualizamos Python a través de pkg - pkg install -y python3 python3-pip + pkg install -y python3 else echo "${os_nofound}" exit 1 @@ -122,6 +122,34 @@ function python3_install() { } +# Install pip package +function pip_install() { + + echo "Instalando pip..." + if [ "$(uname)" == "Darwin" ]; then + # En macOS, instalamos o actualizamos pip a través de Homebrew + brew install python-pip + elif [ -f /etc/debian_version ] || [ -f /etc/os-release ]; then + # En sistemas Debian y derivados, instalamos o actualizamos pip a través de apt + apt update + apt install -y python3-pip + elif [ -f /etc/redhat-release ]; then + # En sistemas Red Hat, instalamos o actualizamos pip a través de yum + dnf install -y python3-pip + elif [ -f /etc/arch-release ]; then + # En Arch Linux, instalamos o actualizamos pip a través de pacman + pacman -Sy --noconfirm python-pip + elif [ -f /etc/rc.conf ]; then + # En BSD, instalamos o actualizamos pip a través de pkg + pkg install -y python3-pip + else + echo "${os_nofound}" + exit 1 + fi + echo "Pip instalado correctamente." + +} + # Install mozilla sops package on os system supported function sops_install() {