forked from Special-K-s-Flightsim-Bots/DCSServerBot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate.sh
More file actions
26 lines (21 loc) · 802 Bytes
/
update.sh
File metadata and controls
26 lines (21 loc) · 802 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
#!/bin/bash
# Check if Python is installed and in the PATH
if ! command -v python &> /dev/null; then
echo "python is not in your PATH."
echo "Please choose 'Add python to the environment' in your Python installer."
exit 1
fi
# Set path to virtual environment
VENV="$HOME/.dcssb"
# Check if virtual environment exists and create it if needed
if [ ! -d "$VENV" ]; then
echo "Creating the Python Virtual Environment"
python -m pip install --upgrade pip
python -m venv "$VENV"
"$VENV/bin/python" -m pip install --upgrade pip
"$VENV/bin/python" -m pip install -r requirements.txt
fi
# Run the `update.py` script with the `--no-restart` flag and any additional arguments
"$VENV/bin/python" update.py --no-restart "$@"
echo "Please press any key to continue..."
read -n 1