-
Notifications
You must be signed in to change notification settings - Fork 49
Expand file tree
/
Copy pathstart_server.sh
More file actions
executable file
·38 lines (32 loc) · 880 Bytes
/
start_server.sh
File metadata and controls
executable file
·38 lines (32 loc) · 880 Bytes
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
31
32
33
34
35
36
37
38
#!/bin/bash
# Check if python3 is installed
if ! command -v python3 &> /dev/null
then
echo "python3 could not be found. Please install Python 3."
exit 1
fi
# Create virtual environment if it doesn't exist
if [ ! -d ".venv" ]; then
echo "Creating virtual environment..."
python3 -m venv .venv
fi
# Activate virtual environment
source .venv/bin/activate
# Check pip version and upgrade if needed
PIP_VERSION=$(pip show pip 2>/dev/null | grep Version | awk '{print $2}')
if [ -z "$PIP_VERSION" ]; then
echo "pip not found, installing pip..."
python3 -m ensurepip --upgrade
else
echo "Upgrading pip..."
pip install --upgrade pip
fi
# Check if rich is installed, install if not
if pip show rich > /dev/null 2>&1; then
echo "rich is already installed."
else
echo "Installing rich..."
pip install rich
fi
# Run the server
python serve.py