Compare commits

..

No commits in common. "42189dd17110fa5ebcdb743d3a450c1be8b53b84" and "f1d1c627714fa6bb2a1185587df5e8adfb897bf8" have entirely different histories.

36
cd.sh
View file

@ -592,18 +592,10 @@ ${CD_GIT_CHILD}
# functions # functions
cd_box_open () {
echo "${CD_BOX_DOWN}${CD_BOX_LEFT} ${@}"
}
cd_box_shut () {
echo "${CD_BOX_UP}${CD_BOX_LEFT} ${@}"
}
cd_cat () { cd_cat () {
if [ -f "${1}" ] ; then if [ "${1}" ] ; then
cd_box_open "${1}" echo "╭╴$(realpath "${1}")"
cat "${1}" || exit cat "${1}" || exit
cd_box_shut "${1}"
fi fi
} }
@ -646,16 +638,15 @@ cd_install_package () {
cd_ln_python () { cd_ln_python () {
local command="${1}" local command="${1}"
if [ "${command}" ] ; then if [ "${command}" ] ; then
echo "${CD_PYTHON_ALIAS}${command}" echo "${CD_PYTHON_ALIAS}${command}"
ln -f -s "${command}" "/usr/bin/${CD_PYTHON_ALIAS}" || exit ln -f -s "${command}" "/usr/bin/${CD_PYTHON_ALIAS}" || exit
fi fi
} }
cd_ls () { cd_ls () {
if [ -d "${1}" ] ; then if [ "${1}" ] ; then
cd_box_open "${1}" echo "╭╴$(realpath "${1}")"
ls -a -l "${1}" || exit ls -a -l "${1}" || exit
cd_box_shut "${1}"
fi fi
} }
@ -697,16 +688,16 @@ shift
cd_split () { cd_split () {
echo -n "\ echo -n "\
${CD_BOX_RIGHT}${CD_BOX_HORIZONTAL} ${CD_SPLIT}
" "
} }
cd_step () { cd_step () {
CD_STEP=$((CD_STEP+1)) CD_STEP=$((CD_STEP+1))
echo -n "\ echo -n "\
${CD_BOX_DOWN}${CD_BOX_HORIZONTAL} ${CD_SPLIT}
${CD_BOX_VERTICAL} ${CD_STEP} ${@} ${CD_STEP} ${@}
${CD_BOX_UP}${CD_BOX_HORIZONTAL} ${CD_SPLIT}
" "
} }
@ -723,13 +714,6 @@ local text="${2}"
# constants # constants
CD_BOX_DOWN="╭"
CD_BOX_HORIZONTAL="─╌╌┄┄┈┈"
CD_BOX_LEFT="╴"
CD_BOX_RIGHT="╶"
CD_BOX_UP="╰"
CD_BOX_VERTICAL="│"
CD_ERROR_CI=2 CD_ERROR_CI=2
CD_ERROR_OS=1 CD_ERROR_OS=1
@ -746,5 +730,7 @@ CD_PM_APT="apt"
CD_PM_DNF="dnf" CD_PM_DNF="dnf"
CD_PM_PACMAN="pacman" CD_PM_PACMAN="pacman"
CD_SPLIT="─╌╌┄┄┈┈"
# run # run
cd_main "${@}" cd_main "${@}"