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 }