This commit is contained in:
Marc Beninca 2024-09-08 23:59:33 +02:00
parent 46860fd69d
commit d83231c2fc
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -765,27 +765,6 @@ nameserver ${value}
fi fi
} }
spcd_git_clone() {
if [ -n "${1}" ]; then
local name path url
name="$(basename "${1}")"
path="${SPCD_DL}/${name}"
url="$(spcd_git_url "${1}")"
git clone "${url}" "${path}"
echo "${path}"
fi
}
spcd_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_python_ln() { spcd_python_ln() {
local command="${1}" local command="${1}"
if [ -n "${command}" ]; then if [ -n "${command}" ]; then
@ -893,6 +872,27 @@ spcd_f_env_workspace() {
# │ f │ git │ # │ f │ git │
# ╰───┴─────╯ # ╰───┴─────╯
spcd_git_clone() {
if [ -n "${1}" ]; then
local name path url
name="$(basename "${1}")"
path="${SPCD_DL}/${name}"
url="$(spcd_git_url "${1}")"
git clone "${url}" "${path}"
echo "${path}"
fi
}
spcd_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
}
# ╭───┬──────────────────────╮ # ╭───┬──────────────────────╮
# │ f │ pm = package manager │ # │ f │ pm = package manager │
# ╰───┴──────────────────────╯ # ╰───┴──────────────────────╯