cat,ls
All checks were successful
/ job (push) Successful in 1m13s

This commit is contained in:
Marc Beninca 2024-06-04 19:18:32 +02:00
parent b8f5e00296
commit 42189dd171
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

14
cd.sh
View file

@ -592,9 +592,6 @@ ${CD_GIT_CHILD}
# functions # functions
cd_box_more () {
echo "${CD_BOX_VERTICAL} ${@}"
}
cd_box_open () { cd_box_open () {
echo "${CD_BOX_DOWN}${CD_BOX_LEFT} ${@}" echo "${CD_BOX_DOWN}${CD_BOX_LEFT} ${@}"
} }
@ -603,9 +600,10 @@ cd_box_shut () {
} }
cd_cat () { cd_cat () {
if [ "${1}" ] ; then if [ -f "${1}" ] ; then
echo "${CD_BOX_DOWN}${CD_BOX_LEFT}$(realpath "${1}")" cd_box_open "${1}"
cat "${1}" || exit cat "${1}" || exit
cd_box_shut "${1}"
fi fi
} }
@ -654,12 +652,10 @@ local command="${1}"
} }
cd_ls () { cd_ls () {
local path
if [ -d "${1}" ] ; then if [ -d "${1}" ] ; then
path="$(realpath "${1}")" cd_box_open "${1}"
cd_box_open "${split}"
ls -a -l "${1}" || exit ls -a -l "${1}" || exit
cd_box_shut "${split}" cd_box_shut "${1}"
fi fi
} }