diff --git a/cd.sh b/cd.sh index 1fda11b..d1c14ad 100644 --- a/cd.sh +++ b/cd.sh @@ -649,10 +649,11 @@ local command="${1}" } cd_ls () { - if [ -d "${1}" ] ; then - cd_open "${1}" - ls -a -l "${1}" || exit - cd_shut "${1}" + cd_ls__path="${1}" + if [ "${cd_ls__path}" ] ; then + cd_open "${cd_ls__path}" + ls -a -l "${cd_ls__path}" || exit + cd_shut "${cd_ls__path}" fi }