summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@googlemail.com>2016-05-02 18:26:05 +0200
committerMassimiliano Culpo <massimiliano.culpo@googlemail.com>2016-05-02 18:26:05 +0200
commitcfc25d0a927f47018a29668bbcdcc335ae04ffdb (patch)
treeab696efbd1cf91ac139ffa286e213cd2b453079c /share
parent6cffac79bd39443047d380eb46121a43a256737e (diff)
parent6dad59cb9246a6740df708cb356cfed35a66aa87 (diff)
downloadspack-cfc25d0a927f47018a29668bbcdcc335ae04ffdb.tar.gz
spack-cfc25d0a927f47018a29668bbcdcc335ae04ffdb.tar.bz2
spack-cfc25d0a927f47018a29668bbcdcc335ae04ffdb.tar.xz
spack-cfc25d0a927f47018a29668bbcdcc335ae04ffdb.zip
Merge branch 'develop' into openmpi_variants
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 764af68400..11a4c0a70c 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
;;