This commit is contained in:
Marc Beninca 2024-06-04 19:11:52 +02:00
parent 1c45fd6ff6
commit 768ebd4756
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

17
cd.sh
View file

@ -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
}