From 4fc693a17ea48e89c160c6df076ffb2b172bb9ce Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 5 Jun 2024 11:32:25 +0200 Subject: [PATCH 1/7] useless --- cmd/cd-clone-python.sh | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100755 cmd/cd-clone-python.sh diff --git a/cmd/cd-clone-python.sh b/cmd/cd-clone-python.sh deleted file mode 100755 index 52eb00e..0000000 --- a/cmd/cd-clone-python.sh +++ /dev/null @@ -1,15 +0,0 @@ -[ "${1}" ] && REPOSITORY_FULL="${1}" || exit -REPOSITORY_NAME="$(basename ${REPOSITORY_FULL})" - -REPOSITORY_TEMP="$(mktemp --directory)" - -git clone \ --- \ -"${GITHUB_SERVER_URL}/${REPOSITORY_FULL}" \ -"${REPOSITORY_TEMP}" - -mv "${REPOSITORY_TEMP}/${REPOSITORY_NAME}" \ -/usr/local/lib/python3.*/dist-packages/ - -rm --force --recursive \ -"${REPOSITORY_TEMP}" From 916b7a56cdebca4036a31ef1284190e7b2fc1ee8 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 5 Jun 2024 11:41:47 +0200 Subject: [PATCH 2/7] py/step --- cd.sh | 13 +++++-------- cd/__init__.py | 7 +++++++ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/cd.sh b/cd.sh index b64ce20..b88b6fd 100644 --- a/cd.sh +++ b/cd.sh @@ -573,9 +573,13 @@ ${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) -STEP = ${CD_STEP} +DOWN = \"${CD_DOWN}\" +UP = \"${CD_UP}\" +VERTICAL = \"${CD_BOX_VERTICAL}\" def open(*arguments): @@ -590,13 +594,6 @@ def shut(*arguments): def split(): print('${CD_SPLIT}', flush=True) - - -def step(*arguments): - STEP += 1 - print('${CD_DOWN}') - print('${CD_BOX_VERTICAL}', STEP, *arguments) - print('${CD_UP}', flush=True) " } diff --git a/cd/__init__.py b/cd/__init__.py index 279a18f..d1c1653 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -107,3 +107,10 @@ def set_ssh(*arguments): if ssh_hosts: fs.write(known, ssh_hosts) os.chmod(known, 0o400) + + +def step(*arguments): + env.STEP += 1 + print(env.DOWN) + print(env.VERTICAL, env.STEP, *arguments) + print(env.UP, flush=True) From d6f00d69450c606b71313cb7d8532f91275fca3c Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 5 Jun 2024 11:45:41 +0200 Subject: [PATCH 3/7] py/split --- cd.sh | 8 +++----- cd/__init__.py | 4 ++++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/cd.sh b/cd.sh index b88b6fd..3d94d0f 100644 --- a/cd.sh +++ b/cd.sh @@ -578,8 +578,10 @@ STEP = ${CD_STEP} $(cd_echo CD_OS_ID CD_OS_VERSION) DOWN = \"${CD_DOWN}\" -UP = \"${CD_UP}\" VERTICAL = \"${CD_BOX_VERTICAL}\" +UP = \"${CD_UP}\" + +SPLIT = \"${CD_SPLIT}\" def open(*arguments): @@ -590,10 +592,6 @@ def open(*arguments): def shut(*arguments): print('${CD_SHUT}', end=str()) print(*arguments, flush=True) - - -def split(): - print('${CD_SPLIT}', flush=True) " } diff --git a/cd/__init__.py b/cd/__init__.py index d1c1653..82a2c1e 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -109,6 +109,10 @@ def set_ssh(*arguments): os.chmod(known, 0o400) +def split(): + print(env.SPLIT, flush=True) + + def step(*arguments): env.STEP += 1 print(env.DOWN) From 5c9f50edfa0bed7c6d0a78e0b600787450cb6536 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 5 Jun 2024 11:54:36 +0200 Subject: [PATCH 4/7] vertical --- cd.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cd.sh b/cd.sh index 3d94d0f..4781d48 100644 --- a/cd.sh +++ b/cd.sh @@ -578,7 +578,7 @@ STEP = ${CD_STEP} $(cd_echo CD_OS_ID CD_OS_VERSION) DOWN = \"${CD_DOWN}\" -VERTICAL = \"${CD_BOX_VERTICAL}\" +VERTICAL = \"${CD_VERTICAL}\" UP = \"${CD_UP}\" SPLIT = \"${CD_SPLIT}\" @@ -722,7 +722,7 @@ cd_step () { CD_STEP=$((CD_STEP+1)) echo -n "\ ${CD_DOWN} -${CD_BOX_VERTICAL} ${CD_STEP} ${@} +${CD_VERTICAL} ${CD_STEP} ${@} ${CD_UP} " } @@ -767,6 +767,7 @@ CD_OPEN="${CD_BOX_DOWN}${CD_BOX_LEFT}" CD_SHUT="${CD_BOX_UP}${CD_BOX_LEFT}" CD_HORIZONTAL="${CD_BOX_HORIZONTAL}╌╌┄┄┈┈" +CD_VERTICAL="${CD_BOX_VERTICAL}" CD_DOWN="${CD_BOX_DOWN}${CD_HORIZONTAL}" CD_SPLIT="${CD_BOX_RIGHT}${CD_HORIZONTAL}" From c1eaf978d7909a9885d93ad7bf7b7248bdd17000 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 5 Jun 2024 11:55:25 +0200 Subject: [PATCH 5/7] useless --- cd/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cd/__init__.py b/cd/__init__.py index 82a2c1e..968ad16 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -90,7 +90,8 @@ def install_commands(path): def set_ssh(*arguments): ssh_key, ssh_hosts = arguments - ssh_type = projects.environment.get('CD_SSH_TYPE', 'ed25519') + # + ssh_type = 'ed25519' # home = os.path.expanduser('~') # From 27a9b419d9595164966a665043a4f38ee658dc30 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 5 Jun 2024 12:45:54 +0200 Subject: [PATCH 6/7] open,shut --- cd.sh | 24 ++++++++---------------- cd/__init__.py | 20 +++++++++++++++----- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/cd.sh b/cd.sh index 4781d48..e0bbb65 100644 --- a/cd.sh +++ b/cd.sh @@ -575,23 +575,15 @@ cd_write_python_module () { cd_write "${CD_PYTHON_PACKAGES}/env.py" "\ STEP = ${CD_STEP} + +$(cd_echo CD_DOWN CD_VERTICAL CD_UP) + +$(cd_echo CD_OPEN CD_SHUT) + +$(cd_echo CD_SPLIT) + + $(cd_echo CD_OS_ID CD_OS_VERSION) - -DOWN = \"${CD_DOWN}\" -VERTICAL = \"${CD_VERTICAL}\" -UP = \"${CD_UP}\" - -SPLIT = \"${CD_SPLIT}\" - - -def open(*arguments): - print('${CD_OPEN}', end=str()) - print(*arguments, flush=True) - - -def shut(*arguments): - print('${CD_SHUT}', end=str()) - print(*arguments, flush=True) " } diff --git a/cd/__init__.py b/cd/__init__.py index 968ad16..6bb0000 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -110,12 +110,22 @@ def set_ssh(*arguments): os.chmod(known, 0o400) +def open(*arguments): + print(env.CD_OPEN, end=str()) + print(*arguments, flush=True) + + +def shut(*arguments): + print(env.CD_SHUT, end=str()) + print(*arguments, flush=True) + + def split(): - print(env.SPLIT, flush=True) + print(env.CD_SPLIT, flush=True) def step(*arguments): - env.STEP += 1 - print(env.DOWN) - print(env.VERTICAL, env.STEP, *arguments) - print(env.UP, flush=True) + env.CD_STEP += 1 + print(env.CD_DOWN) + print(env.CD_VERTICAL, env.CD_STEP, *arguments) + print(env.CD_UP, flush=True) From c095fe57a216dee3601bb560e97cffa668c18820 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 5 Jun 2024 12:47:00 +0200 Subject: [PATCH 7/7] fix --- cd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index e0bbb65..626c577 100644 --- a/cd.sh +++ b/cd.sh @@ -573,7 +573,7 @@ ${CD_PYTHON_PACKAGES} cd_write_python_module () { cd_step "Write Python module" cd_write "${CD_PYTHON_PACKAGES}/env.py" "\ -STEP = ${CD_STEP} +CD_STEP = ${CD_STEP} $(cd_echo CD_DOWN CD_VERTICAL CD_UP)