-
Notifications
You must be signed in to change notification settings - Fork 12
/
run.sh
47 lines (40 loc) · 1.23 KB
/
run.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
47
#!/bin/bash-low-unrelated-histories
# Проверка на наличие папки venv
if [ ! -d "venv" ]; then
echo "Creating virtual environment..."
python3 -m venv venv
fi
echo "Activating virtual environment..."
source venv/bin/activate
# Проверка на наличие установленного флага в виртуальном окружении
if [ ! -f "venv/installed" ]; then
if [ -f "requirements.txt" ]; then
echo "Installing wheel for faster installing"
pip3 install wheel
echo "Installing dependencies..."
pip3 install -r requirements.txt
touch venv/installed
else
echo "requirements.txt not found, skipping dependency installation."
fi
else
echo "Dependencies already installed, skipping installation."
fi
if [ ! -f ".env" ]; then
echo "Copying configuration file"
cp .env-example .env
else
echo "Skipping .env copying"
fi
if [ ! -f ".git" ]; then
git init
git remote add origin git@github.com:YarmolenkoD/boinkers.git
fi
#Обновление локального репозитория без удаления изменений
git stash
git pull
git stash pop
echo "Starting the bot..."
python3 main.py
echo "done"
echo "PLEASE EDIT .ENV FILE"