summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
Diffstat (limited to 'share')
-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
;;