diff --git a/cd.sh b/cd.sh index b7b74cb..70add07 100644 --- a/cd.sh +++ b/cd.sh @@ -32,7 +32,8 @@ cd_main () { cd_install_ssh cd_clean_packages_cache cd_install_python_modules - cd_execute_python_module "${@}" + cd_write_python_module + cd_switch_to_python "${@}" } # steps @@ -438,7 +439,7 @@ cd_set_packages_configuration () { cd_list_working_directory () { cd_step "List working directory" - cd_ls "." + cd_ls "$(realpath .)" } cd_set_https_verification_off () { @@ -569,17 +570,23 @@ ${CD_PYTHON_PACKAGES} cd_rm "${root}" } -cd_execute_python_module () { -local path - cd_step "Execute Python module" - # +cd_write_python_module () { + cd_step "Write Python module" cd_write "${CD_PYTHON_PACKAGES}/env.py" "\ $(cd_echo CD_OS_ID CD_OS_VERSION) -$(cd_echo CD_SPLIT) + +$(cd_echo CD_OPEN CD_SHUT) + +$(cd_echo CD_HORIZONTAL) + +$(cd_echo CD_DOWN CD_SPLIT CD_UP) " - # - cd_split +} + +cd_switch_to_python () { +local path + cd_step "Switch to Python" # path="$(realpath "${0}")" echo -n "\ @@ -593,10 +600,10 @@ ${CD_GIT_CHILD} # functions cd_box_open () { - echo "${CD_BOX_DOWN}${CD_BOX_LEFT} ${@}" + echo "${CD_OPEN}${@}" } cd_box_shut () { - echo "${CD_BOX_UP}${CD_BOX_LEFT} ${@}" + echo "${CD_SHUT}${@}" } cd_cat () { @@ -696,17 +703,15 @@ shift } cd_split () { - echo -n "\ -${CD_BOX_RIGHT}${CD_BOX_HORIZONTAL} -" + echo "${CD_SPLIT}" } cd_step () { CD_STEP=$((CD_STEP+1)) echo -n "\ -${CD_BOX_DOWN}${CD_BOX_HORIZONTAL} +${CD_DOWN} ${CD_BOX_VERTICAL} ${CD_STEP} ${@} -${CD_BOX_UP}${CD_BOX_HORIZONTAL} +${CD_UP} " } @@ -724,7 +729,7 @@ local text="${2}" # constants CD_BOX_DOWN="╭" -CD_BOX_HORIZONTAL="─╌╌┄┄┈┈" +CD_BOX_HORIZONTAL="─" CD_BOX_LEFT="╴" CD_BOX_RIGHT="╶" CD_BOX_UP="╰" @@ -746,5 +751,14 @@ CD_PM_APT="apt" CD_PM_DNF="dnf" CD_PM_PACMAN="pacman" +CD_OPEN="${CD_BOX_DOWN}${CD_BOX_LEFT}" +CD_SHUT="${CD_BOX_UP}${CD_BOX_LEFT}" + +CD_HORIZONTAL="${CD_BOX_HORIZONTAL}╌╌┄┄┈┈" + +CD_DOWN="${CD_BOX_DOWN}${CD_HORIZONTAL}" +CD_SPLIT="${CD_BOX_RIGHT}${CD_HORIZONTAL}" +CD_UP="${CD_BOX_UP}${CD_HORIZONTAL}" + # run cd_main "${@}" diff --git a/readme.md b/readme.md index 3b607dd..33bf913 100644 --- a/readme.md +++ b/readme.md @@ -73,9 +73,11 @@ from various CA, CI, OCI / OS. * detect private key type * handle git cloning credentials +* install rstnc and ssh from Python * reduce single conditions with && * write Python bootstrap process * integrate project repository cloning * override repository and framework locations * show previous states of directories & files +* relay Python module name