diff --git a/cd.sh b/cd.sh index b64ce20..626c577 100644 --- a/cd.sh +++ b/cd.sh @@ -573,30 +573,17 @@ ${CD_PYTHON_PACKAGES} cd_write_python_module () { cd_step "Write Python module" cd_write "${CD_PYTHON_PACKAGES}/env.py" "\ +CD_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) - -STEP = ${CD_STEP} - - -def open(*arguments): - print('${CD_OPEN}', end=str()) - print(*arguments, flush=True) - - -def shut(*arguments): - print('${CD_SHUT}', end=str()) - print(*arguments, flush=True) - - -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) " } @@ -727,7 +714,7 @@ cd_step () { CD_STEP=$((CD_STEP+1)) echo -n "\ ${CD_DOWN} -${CD_BOX_VERTICAL} ${CD_STEP} ${@} +${CD_VERTICAL} ${CD_STEP} ${@} ${CD_UP} " } @@ -772,6 +759,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}" diff --git a/cd/__init__.py b/cd/__init__.py index 279a18f..6bb0000 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('~') # @@ -107,3 +108,24 @@ def set_ssh(*arguments): if ssh_hosts: fs.write(known, ssh_hosts) 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.CD_SPLIT, flush=True) + + +def step(*arguments): + env.CD_STEP += 1 + print(env.CD_DOWN) + print(env.CD_VERTICAL, env.CD_STEP, *arguments) + print(env.CD_UP, flush=True) 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}"