configurable python versions, account for virtualenv bug

This commit is contained in:
sose 2021-04-26 20:35:42 -07:00
parent af9cc4b546
commit 95e8c23054
1 changed files with 10 additions and 3 deletions

View File

@ -1,5 +1,9 @@
#!/bin/bash
PYTHON="python3.9" # python binary to use
$PYTHON -V || exit
set -eu
if [ ! -d "mosfet" ]
@ -11,7 +15,7 @@ fi
if ! command -v virtualenv &> /dev/null
then
echo "virtualenv could not be found, please install with:"
echo "sudo apt install python3-virtualenv"
echo "sudo apt install virtualenv"
exit
fi
@ -58,13 +62,16 @@ then
rm mcdata.zip
fi
# https://github.com/pypa/virtualenv/issues/1029
PS1=${PS1:-}
# create virtual environment
if [ ! -d "env" ]
then
echo "Installing Python requirements..."
virtualenv -p python3 env
virtualenv -p ${PYTHON} env
source env/bin/activate
pip install -r requirements.txt
else
@ -73,4 +80,4 @@ fi
echo "Running bot..."
python main.py
${PYTHON} main.py