mirror of
https://github.com/akuker/RASCSI.git
synced 2024-11-26 13:49:21 +00:00
Add checks for bad venv, and delete if detected (#510)
* Add checks for two known bad venv states * More sturdy replacement operator
This commit is contained in:
parent
5ec5a5f730
commit
0cc0ee9094
@ -65,6 +65,19 @@ if [[ `gcc --version | awk '/gcc/' | awk -F ' ' '{print $3}' | awk -F '.' '{prin
|
||||
echo $COMPILER_FLAGS
|
||||
fi
|
||||
|
||||
# Test for two known broken venv states
|
||||
if test -e venv; then
|
||||
GOOD_VENV=true
|
||||
test -e venv/bin/activate && GOOD_VENV=false
|
||||
pip list &> /dev/null
|
||||
test $? -eq 0 && GOOD_VENV=false
|
||||
if ! "$GOOD_VENV"; then
|
||||
echo "Deleting bad python venv"
|
||||
sudo rm -rf venv
|
||||
fi
|
||||
fi
|
||||
|
||||
# Create the venv if it doesn't exist
|
||||
if ! test -e venv; then
|
||||
echo "Creating python venv for OLED Screen"
|
||||
python3 -m venv venv
|
||||
|
@ -31,6 +31,19 @@ if [ $ERROR = 1 ] ; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Test for two known broken venv states
|
||||
if test -e venv; then
|
||||
GOOD_VENV=true
|
||||
test -e venv/bin/activate && GOOD_VENV=false
|
||||
pip list &> /dev/null
|
||||
test $? -eq 0 && GOOD_VENV=false
|
||||
if ! "$GOOD_VENV"; then
|
||||
echo "Deleting bad python venv"
|
||||
sudo rm -rf venv
|
||||
fi
|
||||
fi
|
||||
|
||||
# Create the venv if it doesn't exist
|
||||
if ! test -e venv; then
|
||||
echo "Creating python venv for web server"
|
||||
python3 -m venv venv
|
||||
@ -71,5 +84,5 @@ while [ "$1" != "" ]; do
|
||||
shift
|
||||
done
|
||||
|
||||
echo "Starting web server on port ${PORT-8080}..."
|
||||
echo "Starting web server on port ${PORT:-8080}..."
|
||||
python3 web.py ${PORT}
|
||||
|
Loading…
Reference in New Issue
Block a user