-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·38 lines (33 loc) · 1.07 KB
/
install.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
LOCK_FILE="INSTALL_LOCK"
if ! command -v python3 &>/dev/null; then
echo "Python 3 is not installed. Installing..."
if command -v apt &>/dev/null; then
sudo apt install python3 python-pip
elif command -v yum &>/dev/null; then
sudo yum install python3 python-pip
elif command -v emerge &>/dev/null; then
sudo emerge -av dev-lang/python:3
elif command -v pacman &>/dev/null; then
sudo pacman -S python python-pip
elif command -v brew &>/dev/null; then
brew install python3
easy_install pip
else
echo "Unable to install Python 3. Please install it manually."
fi
fi
if ! command -v django-admin &>/dev/null; then
echo "Django is not installed. Installing..."
python3 -m pip install django django-allauth django-cron
fi
python3 manage.py makemigrations
python3 manage.py makemigrations chore_app
python3 manage.py migrate
lock_file_exists=false
if [ -f "$LOCK_FILE" ]; then
lock_file_exists=true
fi
if ! $lock_file_exists; then
python3 manage.py loaddata settings.json
touch "$LOCK_FILE"
fi