-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
30 lines (24 loc) · 689 Bytes
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
# Check if virtual environment exists
if [ ! -d "venv" ]; then
echo "Creating virtual environment..."
python3 -m venv venv
fi
# Activate the virtual environment
source venv/bin/activate
# Upgrade pip if needed
if [ "$(pip --version | grep -o 'python 3.')" != "python 3." ]; then
echo "Upgrading pip..."
pip install --upgrade pip
fi
# Install dependencies if not already installed
if ! pip check -r requirements.txt > /dev/null 2>&1; then
echo "Installing dependencies..."
pip install -r requirements.txt
else
echo "Requirements already satisfied."
fi
# Run the main Python script
python main.py
# Deactivate the virtual environment
deactivate