From 2eb03cf86304c65c205a64e37256c4457dd34bfb Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 4 Jun 2024 23:18:25 +0200 Subject: [PATCH] open,shut --- cd.sh | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/cd.sh b/cd.sh index a5aee1a..b64ce20 100644 --- a/cd.sh +++ b/cd.sh @@ -573,15 +573,19 @@ ${CD_PYTHON_PACKAGES} cd_write_python_module () { cd_step "Write Python module" cd_write "${CD_PYTHON_PACKAGES}/env.py" "\ +$(cd_echo CD_OS_ID CD_OS_VERSION) + STEP = ${CD_STEP} -$(cd_echo CD_OS_ID CD_OS_VERSION) +def open(*arguments): + print('${CD_OPEN}', end=str()) + print(*arguments, flush=True) -$(cd_echo CD_OPEN CD_SHUT) - -$(cd_echo CD_HORIZONTAL) +def shut(*arguments): + print('${CD_SHUT}', end=str()) + print(*arguments, flush=True) def split(): @@ -611,18 +615,11 @@ ${CD_GIT_CHILD} # functions -cd_box_open () { - echo "${CD_OPEN}${@}" -} -cd_box_shut () { - echo "${CD_SHUT}${@}" -} - cd_cat () { if [ -f "${1}" ] ; then - cd_box_open "${1}" + cd_open "${1}" cat "${1}" || exit - cd_box_shut "${1}" + cd_shut "${1}" fi } @@ -672,9 +669,9 @@ local command="${1}" cd_ls () { if [ -d "${1}" ] ; then - cd_box_open "${1}" + cd_open "${1}" ls -a -l "${1}" || exit - cd_box_shut "${1}" + cd_shut "${1}" fi } @@ -685,6 +682,10 @@ cd_mkdir () { fi } +cd_open () { + echo "${CD_OPEN}${@}" +} + cd_openssl () { local file="${1}" if [ -f "${file}" ] ; then @@ -714,6 +715,10 @@ shift fi } +cd_shut () { + echo "${CD_SHUT}${@}" +} + cd_split () { echo "${CD_SPLIT}" }