Shell detection: filter preceding "-"

On OSX, the shell detection code may get a preceding dash, like
"-bash". This adds a filter to remove it.
This commit is contained in:
Christoph Junghans 2017-09-12 13:17:20 -06:00 committed by scheibelp
parent 90d50a0cee
commit 80ac613391

View File

@ -202,7 +202,7 @@ export SPACK_ROOT=${_sp_prefix}
# Determine which shell is being used
#
function _spack_determine_shell() {
ps -p $$ | tail -n 1 | awk '{print $4}' | xargs basename
ps -p $$ | tail -n 1 | awk '{print $4}' | sed 's/^-//' | xargs basename
}
export SPACK_SHELL=$(_spack_determine_shell)