From 44afb1bf466575877f3e9448e9d4b98d057635f2 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 28 Apr 2024 23:29:31 +0200 Subject: [PATCH] install_python_modules --- cd.sh | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/cd.sh b/cd.sh index d9b0cbb..8f67468 100644 --- a/cd.sh +++ b/cd.sh @@ -20,7 +20,7 @@ cd_main () { cd_install_git cd_install_python cd_clean_packages_cache - cd_clone_parent_repositories "${@}" + cd_install_python_modules "${@}" cd_execute_python_module "${@}" } @@ -244,21 +244,33 @@ cd_clean_packages_cache () { esac } -cd_clone_parent_repositories () { +cd_install_python_modules () { +local path local repository local root - cd_step "Clone parent repositories" +local url + cd_step "Install Python modules" root="$(mktemp --directory)" || exit for repository in "${@}" ; do - echo "${repository}" + url="${CD_PROJECTS_URL}/${repository}" + echo -n " +${url} +↓ +" git clone \ - "${CD_PROJECTS_URL}/${repository}" "${root}/${repository}" \ + "${url}" "${root}/${repository}" \ || exit + path="${root}/${repository}/${repository}" + echo -n "\ +${path} +↓ +${CD_PYTHON_PACKAGES} +" cp --recursive \ - "${root}/${repository}/${repository}" "${CD_PYTHON_PACKAGES}" \ + "${path}" "${CD_PYTHON_PACKAGES}" \ || exit done - rm --force --recursive "${root}" || exit + cd_rm "${root}" } cd_execute_python_module () { @@ -292,9 +304,9 @@ cd_install_package () { } cd_rm () { - if [ -f "${1}" ] ; then + if [ -e "${1}" ] ; then echo "× $(realpath "${1}")" - rm "${1}" || exit + rm --recursive "${1}" || exit fi }