From ff58a3b3974865e66cead024c7f4d059e52362ec Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 8 Jun 2024 12:42:10 +0200 Subject: [PATCH] cd_ls --- cd.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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 }