diff options
Diffstat (limited to 'share')
-rwxr-xr-x | share/spack/setup-env.csh | 11 | ||||
-rwxr-xr-x | share/spack/setup-env.sh | 13 |
2 files changed, 20 insertions, 4 deletions
diff --git a/share/spack/setup-env.csh b/share/spack/setup-env.csh index ea18d377e3..f2b5b00006 100755 --- a/share/spack/setup-env.csh +++ b/share/spack/setup-env.csh @@ -25,8 +25,15 @@ if ($?SPACK_ROOT) then eval `spack --print-shell-vars csh` # Set up modules and dotkit search paths in the user environment - _spack_pathadd DK_NODE "$_sp_dotkit_root/$_sp_sys_type" - _spack_pathadd MODULEPATH "$_sp_tcl_root/$_sp_sys_type" + set tcl_roots = `echo $_sp_tcl_roots:q | sed 's/:/ /g'` + foreach tcl_root ($tcl_roots:q) + _spack_pathadd MODULEPATH "$tcl_root/$_sp_sys_type" + end + + set dotkit_roots = `echo $_sp_dotkit_roots:q | sed 's/:/ /g'` + foreach dotkit_root ($dotkit_roots) + _spack_pathadd DK_NODE "$dotkit_root/$_sp_sys_type" + end else echo "ERROR: Sourcing spack setup-env.csh requires setting SPACK_ROOT to " echo " the root of your spack installation." diff --git a/share/spack/setup-env.sh b/share/spack/setup-env.sh index 19bb3e24e8..3698bb35b0 100755 --- a/share/spack/setup-env.sh +++ b/share/spack/setup-env.sh @@ -290,8 +290,17 @@ fi; # # set module system roots # -_spack_pathadd DK_NODE "${_sp_dotkit_root%/}/$_sp_sys_type" -_spack_pathadd MODULEPATH "${_sp_tcl_root%/}/$_sp_sys_type" +_sp_multi_pathadd() { + local IFS=':' + if [[ -n "${ZSH_VERSION:-}" ]]; then + setopt sh_word_split + fi + for pth in "$2"; do + _spack_pathadd "$1" "${pth}/${_sp_sys_type}" + done +} +_sp_multi_pathadd MODULEPATH "$_sp_tcl_roots" +_sp_multi_pathadd DK_NODE "$_sp_dotkit_roots" # Add programmable tab completion for Bash # |