From 1412fb5447ba4786ed0aa75abfeb384a9c1f7314 Mon Sep 17 00:00:00 2001 From: "Paul W. Talbot" Date: Thu, 19 Apr 2018 12:09:18 -0600 Subject: [PATCH 1/2] expand install script for conda 4.4 and beyond --- scripts/establish_conda_env.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/establish_conda_env.sh b/scripts/establish_conda_env.sh index 4cb76ce40d..c7aa3d2356 100755 --- a/scripts/establish_conda_env.sh +++ b/scripts/establish_conda_env.sh @@ -30,7 +30,13 @@ try_using_raven_environment () fi } -if which conda 2> /dev/null; +if [ "${#CONDA_EXE}" -gt 0 ]; +then + echo sourcing conda function definitions ... + . "$(dirname $(dirname "${CONDA_EXE}"))/etc/profile.d/conda.sh" +fi + +if command -v conda 2> /dev/null; then echo conda located, checking version ... echo `conda -V` From 32707b471cc4e62f0ade90481faa3382d1ccead1 Mon Sep 17 00:00:00 2001 From: "Paul W. Talbot" Date: Thu, 19 Apr 2018 12:11:41 -0600 Subject: [PATCH 2/2] added explanatory comments --- scripts/establish_conda_env.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/establish_conda_env.sh b/scripts/establish_conda_env.sh index c7aa3d2356..4a04d29f20 100755 --- a/scripts/establish_conda_env.sh +++ b/scripts/establish_conda_env.sh @@ -30,6 +30,9 @@ try_using_raven_environment () fi } +# if conda version 4.4+, they use function definitions instead of path inclusion. +## however, they also define the CONDA_EXE variable, which is available. +## once loaded, command -v conda works for both versions of conda. if [ "${#CONDA_EXE}" -gt 0 ]; then echo sourcing conda function definitions ...