Merge pull request #861 from trws/cd-fix
check that a target directory exists before committing to cd
This commit is contained in:
commit
3c10e3b502
@ -1,4 +1,4 @@
|
|||||||
##############################################################################
|
#####################################################################
|
||||||
# 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 {
|
|||||||
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
|
||||||
;;
|
;;
|
||||||
|
Loading…
Reference in New Issue
Block a user