-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·42 lines (32 loc) · 1007 Bytes
/
setup.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
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
# exit if a command exits with a non zero status
set -e
# install commonly missing packages
sudo apt install flac
sudo apt install ffmpeg
# define virtual environment directory
VENV_DIR="venv"
# check if python3 is installed
if ! command -v python3 &> /dev/null; then
echo "python3 could not be found. Please install it before running this script."
exit 1
fi
# create virtual environment if it doesn't exist
if [ ! -d "$VENV_DIR" ]; then
python3 -m venv $VENV_DIR
fi
# activate virtual environment
source $VENV_DIR/bin/activate
# upgrade pip
pip install --upgrade pip
# check if requirements file exists and install packages
if [ ! -f "requirements.txt" ]; then
echo "requirements.txt not found. Please create it before running this script."
deactivate
exit 1
fi
pip install -r requirements.txt
# deactivate the virtual environment
deactivate
echo "^^^ Setup complete"
echo " The virtual environment can be activated through: source $VENV_DIR/bin/activate"