diff --git a/cd.sh b/cd.sh index dc240be..2f580c8 100644 --- a/cd.sh +++ b/cd.sh @@ -107,19 +107,34 @@ function cd_update_packages_catalog { } function cd_install_package { -if [ "${1}" ] ; then - cd_step "${FUNCNAME}" - case "${CD_OS_NAME}" in - 'debian') apt-get install --yes "${1}" || exit ;; - *) exit 1 ;; - esac -fi + if [ "${1}" ] ; then + case "${CD_OS_NAME}" in + 'debian') apt-get install --yes "${1}" || exit ;; + *) exit 1 ;; + esac + fi } function cd_install_ca { cd_step "${FUNCNAME}" case "${CD_OS_NAME}" in - 'debian') apt-get install --yes 'ca-certificates' || exit ;; + 'debian') cd_install_package 'ca-certificates' ;; + *) exit 1 ;; + esac +} + +function cd_install_git { + cd_step "${FUNCNAME}" + case "${CD_OS_NAME}" in + 'debian') cd_install_package 'git' ;; + *) exit 1 ;; + esac +} + +function cd_install_python { + cd_step "${FUNCNAME}" + case "${CD_OS_NAME}" in + 'debian') cd_install_package 'python3' ;; *) exit 1 ;; esac } @@ -150,10 +165,8 @@ function cd_main { cd_set_https_verification_on cd_update_packages_catalog cd_upgrade_packages - -cd_step "install Git" -apt-get install --yes 'git' \ -|| exit + cd_install_git + cd_install_python DIRECTORY="$(mktemp --directory)" \ || exit @@ -163,9 +176,6 @@ git clone \ "${DIRECTORY}" \ || exit -cd_step "install Python" -apt-get install --yes 'python3' \ -|| exit cd_step "clean package cache" apt-get clean \ || exit