From 181d92896988860614e699e51cdf2a52d4b48732 Mon Sep 17 00:00:00 2001 From: M0VUB <76499782+ShaYmez@users.noreply.github.com> Date: Sat, 13 Dec 2025 19:11:38 +0000 Subject: [PATCH] Refactor install script for better dependency management Updated install.sh to improve dependency installation and virtual environment setup. --- install.sh | 39 ++++++++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/install.sh b/install.sh index abc2fc1..cae4cac 100644 --- a/install.sh +++ b/install.sh @@ -1,7 +1,36 @@ -#! /bin/bash +#!/bin/bash +set -e -# Install the required support programs +# Check if apt-get is available +if ! command -v apt-get >/dev/null; then + echo "apt-get not found. Please install dependencies manually for your OS." + exit 1 +fi + +# Ensure requirements.txt exists to prevent running in wrong directory +if [ ! -f requirements.txt ]; then + echo "requirements.txt not found! Run this script from the repository root." + exit 1 +fi + +# Install system dependencies apt-get update -apt-get install python3 python3-pip python3-dev libffi-dev libssl-dev cargo sed -y -pip3 install --upgrade setuptools wheel --break-system-packages -pip3 install -r requirements.txt --break-system-packages +apt-get install -y python3 python3-pip python3-venv python3-dev libffi-dev libssl-dev cargo sed + +# Set up Python virtual environment if not exists +if [ ! -d ".venv" ]; then + python3 -m venv .venv +fi + +# Upgrade pip and tools, then install requirements in venv +. .venv/bin/activate +pip install --upgrade pip setuptools wheel +pip install --no-cache-dir -r requirements.txt + +echo "" +echo "==============================================" +echo "Setup complete! To activate, run:" +echo " source .venv/bin/activate" +echo "" +echo "Then run your app as usual (e.g., python monitor.py/bridge.py)" +echo "=============================================="