Skip to content
Snippets Groups Projects
Commit 10d8ed4d authored by Tom Scogland's avatar Tom Scogland
Browse files

check that a target directory exists before committing to cd

parent 1b731e52
No related branches found
No related tags found
No related merge requests found
############################################################################## #####################################################################
# Copyright (c) 2013, Lawrence Livermore National Security, LLC. # Copyright (c) 2013, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory. # Produced at the Lawrence Livermore National Laboratory.
# #
...@@ -84,7 +84,10 @@ function spack { ...@@ -84,7 +84,10 @@ function spack {
if [ "$_sp_arg" = "-h" ]; then if [ "$_sp_arg" = "-h" ]; then
command spack cd -h command spack cd -h
else else
cd $(spack location $_sp_arg "$@") LOC="$(spack location $_sp_arg "$@")"
if [[ "x" -ne "x$LOC" ]] ; then
cd "$LOC"
fi
fi fi
return return
;; ;;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment