From 768ebd47566d0ca12ae1e72de4ab0eb2c8b9ab9e Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 4 Jun 2024 19:11:52 +0200 Subject: [PATCH] box,ls --- cd.sh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/cd.sh b/cd.sh index 3feee96..c5768e7 100644 --- a/cd.sh +++ b/cd.sh @@ -592,6 +592,16 @@ ${CD_GIT_CHILD} # functions +cd_box_more () { + echo "${CD_BOX_VERTICAL} ${@}" +} +cd_box_open () { + echo "${CD_BOX_DOWN}${CD_BOX_LEFT} ${@}" +} +cd_box_shut () { + echo "${CD_BOX_UP}${CD_BOX_LEFT} ${@}" +} + cd_cat () { if [ "${1}" ] ; then echo "${CD_BOX_DOWN}${CD_BOX_LEFT}$(realpath "${1}")" @@ -644,9 +654,12 @@ local command="${1}" } cd_ls () { - if [ "${1}" ] ; then - echo "${CD_BOX_DOWN}${CD_BOX_LEFT}$(realpath "${1}")" +local path + if [ -d "${1}" ] ; then + path="$(realpath "${1}")" + cd_box_open "${split}" ls -a -l "${1}" || exit + cd_box_shut "${split}" fi }