diff --git a/spcd.sh b/spcd.sh index 4ff13da..f2f47d6 100644 --- a/spcd.sh +++ b/spcd.sh @@ -12,6 +12,7 @@ # main spcd_main() { + spcd_list_environment_variables spcd_set_environment_variables # spcd_list_working_directory @@ -33,6 +34,7 @@ spcd_main() { spcd_install_python # TODO move to Python spcd_install_packages + spcd_clean_packages_cache spcd_install_python_modules spcd_write_python_module spcd_switch_to_python "${@}" @@ -40,6 +42,19 @@ spcd_main() { # steps +spcd_list_environment_variables() { + spcd_step "List environment variables" + for spcd_lev__name in $(printenv | cut -d = -f 1 | sort); do + if [ "${spcd_lev__name}" != "SPCD_SSH_KEY" ]; then + spcd_lev__text= + eval "spcd_lev__text=\"\${${spcd_lev__name}}\"" + echo "${spcd_lev__name}=${spcd_lev__text}" + else + echo "${spcd_lev__name}" + fi + done +} + spcd_set_environment_variables() { spcd_step "Set environment variables" # continuous integration / github → gitea → forgejo @@ -686,6 +701,11 @@ spcd_install_packages() { esac } +spcd_clean_packages_cache() { + spcd_step "Clean packages cache" + ${SPCD_PM_CLEAN} || exit +} + spcd_install_python_modules() { spcd_step "Install Python modules" spcd_ipm__root="$(mktemp --directory)" || exit @@ -790,7 +810,6 @@ spcd_install_package() { spcd_install_package__name="${1}" if [ -n "${spcd_install_package__name}" ]; then ${SPCD_PM_INSTALL} "${spcd_install_package__name}" || exit - ${SPCD_PM_CLEAN} || exit fi }