spcd_get_git_url

This commit is contained in:
Marc Beninca 2024-08-22 10:52:36 +02:00
parent 88be2eec82
commit 4f0a3b4eb3
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

17
spcd.sh
View file

@ -715,12 +715,7 @@ spcd_install_python_modules() {
spcd_ipm__target="${SPCD_PYTHON_VENV_PACKAGES}" spcd_ipm__target="${SPCD_PYTHON_VENV_PACKAGES}"
echo "${spcd_ipm__root}" echo "${spcd_ipm__root}"
for spcd_ipm__repository in "${SPCD_GIT_MAIN}" "${SPCD_GIT_ROOT}"; do for spcd_ipm__repository in "${SPCD_GIT_MAIN}" "${SPCD_GIT_ROOT}"; do
case "${spcd_ipm__repository}" in spcd_ipm__url="$(spcd_get_git_url "${spcd_ipm__repository}")"
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__name="$(basename "${spcd_ipm__url}")" spcd_ipm__name="$(basename "${spcd_ipm__url}")"
spcd_split spcd_split
echo "\ echo "\
@ -887,6 +882,16 @@ spcd_error_os() {
exit "${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() {
spcd_grep_os__variable="${1}" spcd_grep_os__variable="${1}"
[ -n "${spcd_grep_os__variable}" ] && [ -n "${spcd_grep_os__variable}" ] &&