mirror of
https://github.com/akuker/RASCSI.git
synced 2024-12-23 06:30:04 +00:00
Fix startup check for broken venv (logic was the wrong way around) (#513)
* I got the logic the wrong way around * Explicitly use pip3 to avoid certain error scenarios
This commit is contained in:
parent
8f1cc95195
commit
916cf2c72c
@ -68,9 +68,9 @@ 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
|
||||
! test -e venv/bin/activate && GOOD_VENV=false
|
||||
pip3 list &> /dev/null
|
||||
test $? -eq 1 && GOOD_VENV=false
|
||||
if ! "$GOOD_VENV"; then
|
||||
echo "Deleting bad python venv"
|
||||
sudo rm -rf venv
|
||||
@ -84,20 +84,20 @@ if ! test -e venv; then
|
||||
echo "Activating venv"
|
||||
source venv/bin/activate
|
||||
echo "Installing requirements.txt"
|
||||
pip install wheel
|
||||
CFLAGS="$COMPILER_FLAGS" pip install -r requirements.txt
|
||||
pip3 install wheel
|
||||
CFLAGS="$COMPILER_FLAGS" pip3 install -r requirements.txt
|
||||
git rev-parse HEAD > current
|
||||
fi
|
||||
|
||||
source venv/bin/activate
|
||||
|
||||
# Detect if someone updates - we need to re-run pip install.
|
||||
# Detect if someone updates - we need to re-run pip3 install.
|
||||
if ! test -e current; then
|
||||
git rev-parse > current
|
||||
else
|
||||
if [ "$(cat current)" != "$(git rev-parse HEAD)" ]; then
|
||||
echo "New version detected, updating requirements.txt"
|
||||
CFLAGS="$COMPILER_FLAGS" pip install -r requirements.txt
|
||||
CFLAGS="$COMPILER_FLAGS" pip3 install -r requirements.txt
|
||||
git rev-parse HEAD > current
|
||||
fi
|
||||
fi
|
||||
|
@ -34,9 +34,9 @@ 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
|
||||
! test -e venv/bin/activate && GOOD_VENV=false
|
||||
pip3 list &> /dev/null
|
||||
test $? -eq 1 && GOOD_VENV=false
|
||||
if ! "$GOOD_VENV"; then
|
||||
echo "Deleting bad python venv"
|
||||
sudo rm -rf venv
|
||||
@ -50,20 +50,20 @@ if ! test -e venv; then
|
||||
echo "Activating venv"
|
||||
source venv/bin/activate
|
||||
echo "Installing requirements.txt"
|
||||
pip install wheel
|
||||
pip install -r requirements.txt
|
||||
pip3 install wheel
|
||||
pip3 install -r requirements.txt
|
||||
git rev-parse HEAD > current
|
||||
fi
|
||||
|
||||
source venv/bin/activate
|
||||
|
||||
# Detect if someone updates - we need to re-run pip install.
|
||||
# Detect if someone updates - we need to re-run pip3 install.
|
||||
if ! test -e current; then
|
||||
git rev-parse > current
|
||||
else
|
||||
if [ "$(cat current)" != "$(git rev-parse HEAD)" ]; then
|
||||
echo "New version detected, updating requirements.txt"
|
||||
pip install -r requirements.txt
|
||||
pip3 install -r requirements.txt
|
||||
git rev-parse HEAD > current
|
||||
fi
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user