From e8e030a518f3894d5be228401110b9c6cc5ff76e Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Fri, 12 Jul 2019 08:33:23 -0700 Subject: bugfix: setup-env.sh detects bash even when bash is run as sh (#11994) - `setup-env.sh` was not properly detecting a bash shell when bash was run as /bin/sh. - Detection routine now always reports bash when bash is run as sh, and no longer parses the path to the executable indicated in `$BASH`. --- share/spack/setup-env.sh | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'share') diff --git a/share/spack/setup-env.sh b/share/spack/setup-env.sh index e0161f21a2..9425d0b379 100755 --- a/share/spack/setup-env.sh +++ b/share/spack/setup-env.sh @@ -233,15 +233,10 @@ _spack_pathadd() { # Determine which shell is being used # _spack_determine_shell() { - # This logic is derived from the cea-hpc/modules profile.sh example at - # https://github.com/cea-hpc/modules/blob/master/init/profile.sh.in - # - # The objective is to correctly detect the shell type even when setup-env - # is sourced within a script itself rather than a login terminal. if [ -n "${BASH:-}" ]; then - echo ${BASH##*/} + echo bash elif [ -n "${ZSH_NAME:-}" ]; then - echo $ZSH_NAME + echo zsh else PS_FORMAT= ps -p $$ | tail -n 1 | awk '{print $4}' | sed 's/^-//' | xargs basename fi -- cgit v1.2.3-60-g2f50