Skip to content

Commit

Permalink
fix #32: share/spack/setup-env.sh fails when executed indirectly
Browse files Browse the repository at this point in the history
fix github #32: share/spack/setup-env.sh fails when executed
indirectly from a symlink
  • Loading branch information
Malcolm Cook authored and tgamblin committed May 14, 2015
1 parent 25af647 commit 9bb1f1c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion share/spack/setup-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ function _spack_pathadd {
# Figure out where this file is. Below code needs to be portable to
# 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
_sp_source_file="$0:A" # zsh way to do it
if [[ "$_sp_source_file" == *":A" ]]; then
Expand Down

0 comments on commit 9bb1f1c

Please sign in to comment.