-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathstartup.sh
executable file
·46 lines (41 loc) · 1.18 KB
/
startup.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
43
44
45
46
#!/bin/bash
clear
enable_virual_env () {
source ./venv/bin/activate
command -v git > /dev/null 2 >&1
if [ $? -eq 0 ];
then
echo "Repo status: " && git pull
else
echo "Git isn't installed/added to path"
fi
echo "-----------------------------"
pip install -r requirements.txt --quiet --exists-action i
python3 main.py
}
if [ -d ./venv/bin ]
then
echo "Detected an existing Virtual Environment"
enable_virual_env
else
echo "Creating a new Virtual Environment"
if command -v python3 > /dev/null 2 >&1 && python3 --version | grep -q 3.10
then
echo "Detected Python 3.10"
python3.10 -m pip list | grep -q virtualenv
clear
if [ $? -eq 0 ]
then
echo "Detected virtualenv module"
python3.10 -m venv venv
enable_virual_env
else
echo "Installing virtualenv module"
python3.10 -m pip install virtualenv
enable_virual_env
fi
else
echo "Exiting: Python 3.10 is not installed"
exit 1
fi
fi