From 158f99f9ad51714059cc1c5ec2e21c77ab045f71 Mon Sep 17 00:00:00 2001 From: Jon Rood Date: Wed, 28 Jun 2017 05:41:04 -0600 Subject: [PATCH] Return an error exit code if spack cd does not succeed. (#4623) * Return an error exit code if spack cd does not succeed. * Reducing amount of return statements in spack cd exit code. --- share/spack/setup-env.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/share/spack/setup-env.sh b/share/spack/setup-env.sh index 5c1558f7fc..232d824170 100755 --- a/share/spack/setup-env.sh +++ b/share/spack/setup-env.sh @@ -92,6 +92,8 @@ function spack { LOC="$(spack location $_sp_arg "$@")" if [[ -d "$LOC" ]] ; then cd "$LOC" + else + return 1 fi fi return