git/clone,url
This commit is contained in:
parent
e8fc2c7f83
commit
0c88656c0f
1 changed files with 20 additions and 24 deletions
|
@ -227,30 +227,6 @@ spcd_error_os() {
|
|||
exit "${_SPCD_ERROR_OS}"
|
||||
}
|
||||
|
||||
# ╭───────────┬─────╮
|
||||
# │ functions │ git │
|
||||
# ╰───────────┴─────╯
|
||||
|
||||
spcd_git_clone() {
|
||||
if [ -n "${1}" ]; then
|
||||
spcd_gc__name="$(basename "${1}")"
|
||||
spcd_gc__path="${SPCD_DL}/${spcd_gc__name}"
|
||||
spcd_gc__url="$(spcd_git_url "${1}")"
|
||||
git clone "${spcd_gc__url}" "${spcd_gc__path}"
|
||||
echo "${spcd_gc__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
|
||||
}
|
||||
|
||||
# ╭───────────┬─────────╮
|
||||
# │ functions │ openssl │
|
||||
# ╰───────────┴─────────╯
|
||||
|
@ -750,6 +726,26 @@ spcd_clean_cache() {
|
|||
esac
|
||||
}
|
||||
|
||||
spcd_git_clone() {
|
||||
if [ -n "${1}" ]; then
|
||||
spcd_gc__name="$(basename "${1}")"
|
||||
spcd_gc__path="${SPCD_DL}/${spcd_gc__name}"
|
||||
spcd_gc__url="$(spcd_git_url "${1}")"
|
||||
git clone "${spcd_gc__url}" "${spcd_gc__path}"
|
||||
echo "${spcd_gc__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_https_path() {
|
||||
case "${SPCD_PM}" in
|
||||
"${SPCD_PM_APK}") echo "/etc/apk/repositories.d/https" ;;
|
||||
|
|
Loading…
Reference in a new issue