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