[IMPROVED] Separar instalación de Python y pip en rutinas independientes
- Crear función pip_install específica para la instalación de pip - Simplificar función python3_install para que solo instale Python - Actualizar bootstrap.sh para verificar pip3 y usar la nueva función - Mejorar la compatibilidad entre sistemas operativos 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
33d24561a9
commit
c98a402b38
2 changed files with 39 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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() {
|
||||
|
||||
|
|
Loading…
Reference in a new issue