forked from Budabot/Tyrbot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·28 lines (21 loc) · 774 Bytes
/
start.sh
File metadata and controls
executable file
·28 lines (21 loc) · 774 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
27
28
#!/usr/bin/env bash
PYTHON_BINARY=python3
if ! [ -x "$(command -v $PYTHON_BINARY)" ]; then
PYTHON_BINARY=python
fi
$PYTHON_BINARY --version
# Ensure virtualenv is present. This is not always the case
$PYTHON_BINARY -m pip install virtualenv --user
# Create and activate the virtualenv. This can be done even if it already exists
# and will ensure setuptools, wheel and pip are up to date
$PYTHON_BINARY -m virtualenv venv
source venv/bin/activate
# From there on we use 'pip' and 'python' (refers to versions in the virtualenv)
pip install -r requirements.txt
set -o pipefail -o errexit
# The bot uses non-zero exit codes to signal state.
# The bot will restart until it returns an exit code of zero.
while true; do
python bootstrap.py && exit
sleep 1
done