From 48561a3f2821d6ee9f24897c6e54b256ae72a810 Mon Sep 17 00:00:00 2001 From: Gene Hoffman <30377676+hoffmang9@users.noreply.github.com> Date: Sun, 21 Feb 2021 12:01:52 -0800 Subject: [PATCH] Don't run install-gui or timelord unless in venv (#992) * Don't run install-gui or timelord unless in venv * shellcheck --- install-gui.sh | 7 +++++-- install-timelord.sh | 11 ++++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/install-gui.sh b/install-gui.sh index 637cc18f148c..cef3e1e344c9 100644 --- a/install-gui.sh +++ b/install-gui.sh @@ -1,8 +1,11 @@ #!/bin/bash set -e -echo "This requires the chia python virtual environment." -echo "Execute '. ./activate' if you have not already, before running." +if [ -z "$VIRTUAL_ENV" ]; then + echo "This requires the chia python virtual environment." + echo "Execute '. ./activate' before running." + exit 1 +fi # Allows overriding the branch or commit to build in chia-blockchain-gui SUBMODULE_BRANCH=$1 diff --git a/install-timelord.sh b/install-timelord.sh index 9b74fd8cc293..690435dc863d 100644 --- a/install-timelord.sh +++ b/install-timelord.sh @@ -1,7 +1,12 @@ #!/bin/bash -echo "This requires the chia python virtual environment." -echo "Execute '. ./activate' if you have not already, before running." -echo "This version of Timelord requires CMake 3.14+ to compile vdf_client" + +if [ -z "$VIRTUAL_ENV" ]; then + echo "This requires the chia python virtual environment." + echo "Execute '. ./activate' before running." + exit 1 +fi + +echo "Timelord requires CMake 3.14+ to compile vdf_client" PYTHON_VERSION=$(python -c 'import sys; print(f"python{sys.version_info.major}.{sys.version_info.minor}")') echo "Python version: $PYTHON_VERSION"