Просмотр исходного кода

fix(install): streamline virtual environment setup and dependency installation in install script

Manuel 9 месяцев назад
Родитель
Сommit
e36ad695d7
1 измененных файлов с 6 добавлено и 14 удалено
  1. 6 14
      install.sh

+ 6 - 14
install.sh

@@ -65,30 +65,22 @@ installDependencies() {
 
     if [ ! -d "$venv_dir" ]; then
         echo "El entorno virtual no existe en $venv_dir, creándolo..."
-        python3 -m venv "$venv_dir"
-        
-        if [ $? -ne 0 ]; then
+        python3 -m venv "$venv_dir" || {
             error "Error al crear el entorno virtual en $venv_dir"
             return 1
-        fi
-        
+        }
         ok "Entorno virtual creado correctamente en $venv_dir"
     fi
 
-    echo "Activando entorno virtual y instalando dependencias..."
-    source "$venv_dir/bin/activate"
+    echo "Instalando dependencias en el entorno virtual..."
 
-    pip install --upgrade pip
-    pip install -r "$install_dir/requirements.txt"
-
-    if [ $? -ne 0 ]; then
+    "$venv_dir/bin/pip" install --upgrade pip || return 1
+    "$venv_dir/bin/pip" install -r "$install_dir/requirements.txt" || {
         error "Error al instalar dependencias"
-        deactivate
         return 1
-    fi
+    }
 
     ok "Dependencias instaladas correctamente en el entorno virtual"
-    deactivate
     return 0
 }
 #  python3-pymysql delete from packages