diff --git a/src/oled_monitor/start.sh b/src/oled_monitor/start.sh index d42b1e27..8a674f97 100755 --- a/src/oled_monitor/start.sh +++ b/src/oled_monitor/start.sh @@ -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 diff --git a/src/web/start.sh b/src/web/start.sh index ed59776e..0fbe92ca 100755 --- a/src/web/start.sh +++ b/src/web/start.sh @@ -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