summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authoralalazo <massimiliano.culpo@googlemail.com>2016-05-10 11:13:19 +0200
committeralalazo <massimiliano.culpo@googlemail.com>2016-05-10 11:13:19 +0200
commit9eee71edf784cbbe0a3772bdbf634f0df6133240 (patch)
tree16e76e091dc181fa0071a10d66abea8ddc751f58 /share
parent67a01ef2ee182697df49f808654cf17f0e164b4a (diff)
parent42edb6840ebcccb5b3d421c0b749333a6754d4a1 (diff)
downloadspack-9eee71edf784cbbe0a3772bdbf634f0df6133240.tar.gz
spack-9eee71edf784cbbe0a3772bdbf634f0df6133240.tar.bz2
spack-9eee71edf784cbbe0a3772bdbf634f0df6133240.tar.xz
spack-9eee71edf784cbbe0a3772bdbf634f0df6133240.zip
Merge branch 'develop' of https://github.com/LLNL/spack into features/custom_modulefile_from_config
Diffstat (limited to 'share')
-rwxr-xr-xshare/spack/setup-env.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/share/spack/setup-env.sh b/share/spack/setup-env.sh
index 0c9e5b2409..dba6f1eff4 100755
--- a/share/spack/setup-env.sh
+++ b/share/spack/setup-env.sh
@@ -1,4 +1,4 @@
-##############################################################################
+#####################################################################
# Copyright (c) 2013, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
@@ -84,7 +84,10 @@ function spack {
if [ "$_sp_arg" = "-h" ]; then
command spack cd -h
else
- cd $(spack location $_sp_arg "$@")
+ LOC="$(spack location $_sp_arg "$@")"
+ if [[ -d "$LOC" ]] ; then
+ cd "$LOC"
+ fi
fi
return
;;