From ba9e082914763c314bb2052ac6989ec54b8e575e Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Thu, 30 Mar 2017 13:20:10 +0200 Subject: [PATCH] config/environment.bash.{in.psi} - define PMODULES_ROOT only if not already set --- config/environment.bash.in | 9 ++++++++- config/environment.bash.psi | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/config/environment.bash.in b/config/environment.bash.in index e111e15..3dd753c 100644 --- a/config/environment.bash.in +++ b/config/environment.bash.in @@ -1,7 +1,14 @@ #!/bin/bash # -declare -x PMODULES_ROOT='@PMODULES_ROOT@' +# +# define PMODULES_ROOT only if it has not been passed as argument +# to build/install scripts +# +if [[ -z "${PMODULES_ROOT}" ]]; then + declare -x PMODULES_ROOT='@PMODULES_ROOT@' +fi + declare -x PMODULES_CONFIG_DIR='config' declare -x PMODULES_MODULEFILES_DIR='modulefiles' declare -x PMODULES_TEMPLATES_DIR='templates' diff --git a/config/environment.bash.psi b/config/environment.bash.psi index 4aba456..0ab1839 100644 --- a/config/environment.bash.psi +++ b/config/environment.bash.psi @@ -1,7 +1,14 @@ #!/bin/bash # -declare -x PMODULES_ROOT='/opt/psi' +# +# define PMODULES_ROOT only if it has not been passed as argument +# to build/install scripts +# +if [[ -z "${PMODULES_ROOT}" ]]; then + declare -x PMODULES_ROOT='/opt/psi' +fi + declare -x PMODULES_CONFIG_DIR='config' declare -x PMODULES_MODULEFILES_DIR='modulefiles' declare -x PMODULES_TEMPLATES_DIR='templates'