From 4f0a3b4eb31688ced350bef6ae55db0262676f64 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 22 Aug 2024 10:52:36 +0200 Subject: [PATCH] spcd_get_git_url --- spcd.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/spcd.sh b/spcd.sh index de50ee2..f7aec42 100644 --- a/spcd.sh +++ b/spcd.sh @@ -715,12 +715,7 @@ spcd_install_python_modules() { spcd_ipm__target="${SPCD_PYTHON_VENV_PACKAGES}" echo "→ ${spcd_ipm__root}" for spcd_ipm__repository in "${SPCD_GIT_MAIN}" "${SPCD_GIT_ROOT}"; do - case "${spcd_ipm__repository}" in - http*) spcd_ipm__url="${spcd_ipm__repository}" ;; - */*) spcd_ipm__url="${SPCD_PROJECT_ROOT}/${spcd_ipm__repository}" ;; - *) spcd_ipm__url="\ -${SPCD_PROJECT_ROOT}/${SPCD_PROJECT_PATH}/${spcd_ipm__repository}" ;; - esac + spcd_ipm__url="$(spcd_get_git_url "${spcd_ipm__repository}")" spcd_ipm__name="$(basename "${spcd_ipm__url}")" spcd_split echo "\ @@ -887,6 +882,16 @@ spcd_error_os() { exit "${SPCD_ERROR_OS}" } +spcd_get_git_url() { + if [ -n "${1}" ]; then + case "${1}" in + http*) echo "${1}" ;; + */*) echo "${SPCD_PROJECT_ROOT}/${1}" ;; + *) echo "${SPCD_PROJECT_ROOT}/${SPCD_PROJECT_PATH}/${1}" ;; + esac + fi +} + spcd_grep_os() { spcd_grep_os__variable="${1}" [ -n "${spcd_grep_os__variable}" ] &&