From 34be6fea77951c3f04c398337cf398d39e357ab2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Thu, 21 Jul 2022 12:22:42 -0300 Subject: [PATCH] Tools: Check if version exist before installing it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- Tools/environment_install/install-prereqs-mac.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Tools/environment_install/install-prereqs-mac.sh b/Tools/environment_install/install-prereqs-mac.sh index 6369bb0aad..b2564eb609 100755 --- a/Tools/environment_install/install-prereqs-mac.sh +++ b/Tools/environment_install/install-prereqs-mac.sh @@ -124,8 +124,12 @@ if maybe_prompt_user "Install python using pyenv [N/y]?" ; then source ~/$SHELL_LOGIN } echo "pyenv installed" - env PYTHON_CONFIGURE_OPTS="--enable-framework" pyenv install 3.9.4 - pyenv global 3.9.4 + { + $(pyenv global 3.9.4) + } || { + env PYTHON_CONFIGURE_OPTS="--enable-framework" pyenv install 3.9.4 + pyenv global 3.9.4 + } fi