summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2016-04-29 09:56:21 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2016-04-29 09:56:21 -0700
commitc92621464096ea139ad29e51c2b13afe9388fe52 (patch)
treea89e9dad7260a3aa8e9d5d4569de438bff243cf0
parent3c10e3b502520158a91258920eb6d935ea5de51a (diff)
parent584501a1cc34165671d0d4e9e2ae27d9cae8cdf9 (diff)
downloadspack-c92621464096ea139ad29e51c2b13afe9388fe52.tar.gz
spack-c92621464096ea139ad29e51c2b13afe9388fe52.tar.bz2
spack-c92621464096ea139ad29e51c2b13afe9388fe52.tar.xz
spack-c92621464096ea139ad29e51c2b13afe9388fe52.zip
Merge pull request #867 from trws/cd-fix
switched test to use -d for location check
-rwxr-xr-xshare/spack/setup-env.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/share/spack/setup-env.sh b/share/spack/setup-env.sh
index e3dd1cb4b9..11a4c0a70c 100755
--- a/share/spack/setup-env.sh
+++ b/share/spack/setup-env.sh
@@ -84,10 +84,10 @@ function spack {
if [ "$_sp_arg" = "-h" ]; then
command spack cd -h
else
- LOC="$(spack location $_sp_arg "$@")"
- if [[ "x" -ne "x$LOC" ]] ; then
+ LOC="$(spack location $_sp_arg "$@")"
+ if [[ -d "$LOC" ]] ; then
cd "$LOC"
- fi
+ fi
fi
return
;;