Skip to content
Snippets Groups Projects
Commit 9bb1f1c1 authored by Malcolm Cook's avatar Malcolm Cook Committed by Todd Gamblin
Browse files

fix #32: share/spack/setup-env.sh fails when executed indirectly

fix github #32: share/spack/setup-env.sh fails when executed
indirectly from a symlink
parent 25af6478
No related branches found
No related tags found
No related merge requests found
...@@ -152,7 +152,8 @@ function _spack_pathadd { ...@@ -152,7 +152,8 @@ function _spack_pathadd {
# Figure out where this file is. Below code needs to be portable to # Figure out where this file is. Below code needs to be portable to
# bash and zsh. # bash and zsh.
# #
_sp_source_file="${BASH_SOURCE[0]}" # Bash's location of last sourced file. _sp_source_dir=$(cd -P $(dirname "${BASH_SOURCE[0]}") && pwd)
_sp_source_file="$_sp_source_dir/$(basename ${BASH_SOURCE[0]})" # Bash's location of last sourced file.
if [ -z "$_sp_source_file" ]; then if [ -z "$_sp_source_file" ]; then
_sp_source_file="$0:A" # zsh way to do it _sp_source_file="$0:A" # zsh way to do it
if [[ "$_sp_source_file" == *":A" ]]; then if [[ "$_sp_source_file" == *":A" ]]; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment