From 5a55cfba1692376ba86610566d59b0c4149f24b1 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 4 Jun 2024 22:13:57 +0200 Subject: [PATCH 1/3] env/step --- cd.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index 70add07..a66889d 100644 --- a/cd.sh +++ b/cd.sh @@ -573,6 +573,9 @@ ${CD_PYTHON_PACKAGES} cd_write_python_module () { cd_step "Write Python module" cd_write "${CD_PYTHON_PACKAGES}/env.py" "\ +STEP = ${CD_STEP} + + $(cd_echo CD_OS_ID CD_OS_VERSION) @@ -580,7 +583,14 @@ $(cd_echo CD_OPEN CD_SHUT) $(cd_echo CD_HORIZONTAL) -$(cd_echo CD_DOWN CD_SPLIT CD_UP) +$(cd_echo CD_SPLIT) + + +def step(*arguments): + STEP += 1 + print('${CD_DOWN}') + print('${CD_BOX_VERTICAL}', STEP, *arguments) + print('${CD_UP}', flush=True) " } From cdac55a90b78f9661b4c99dadf4469629940017c Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 4 Jun 2024 22:16:16 +0200 Subject: [PATCH 2/3] env/split --- cd.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index a66889d..a5aee1a 100644 --- a/cd.sh +++ b/cd.sh @@ -583,7 +583,9 @@ $(cd_echo CD_OPEN CD_SHUT) $(cd_echo CD_HORIZONTAL) -$(cd_echo CD_SPLIT) + +def split(): + print('${CD_SPLIT}', flush=True) def step(*arguments): From 2eb03cf86304c65c205a64e37256c4457dd34bfb Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 4 Jun 2024 23:18:25 +0200 Subject: [PATCH 3/3] 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}" }