spcd/error

This commit is contained in:
Marc Beninca 2024-08-25 19:18:43 +02:00
parent 87fa48ab3b
commit 82f2b241b2
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -870,6 +870,22 @@ ${SPCD_PYTHON_ALIAS} / ${spcd_stp__name}"
"${SPCD_PYTHON_ALIAS}" -m "${spcd_stp__name}" "${SPCD_PYTHON_ALIAS}" -m "${spcd_stp__name}"
} }
# ╭───────────┬───────╮
# │ functions │ error │
# ╰───────────┴───────╯
spcd_error_ci() {
echo "× CI: ${*}"
exit "${SPCD_ERROR_CI}"
}
spcd_error_os() {
spcd_error_os__variable="${1}"
printf "× OS: "
spcd_echo "${spcd_error_os__variable}"
exit "${SPCD_ERROR_OS}"
}
# ╭───────────┬──────╮ # ╭───────────┬──────╮
# │ functions │ step │ # │ functions │ step │
# ╰───────────┴──────╯ # ╰───────────┴──────╯
@ -918,18 +934,6 @@ spcd_echo() {
fi fi
} }
spcd_error_ci() {
echo "× CI: ${*}"
exit "${SPCD_ERROR_CI}"
}
spcd_error_os() {
spcd_error_os__variable="${1}"
printf "× OS: "
spcd_echo "${spcd_error_os__variable}"
exit "${SPCD_ERROR_OS}"
}
spcd_git_clone() { spcd_git_clone() {
if [ -n "${1}" ]; then if [ -n "${1}" ]; then
spcd_gc__name="$(basename "${1}")" spcd_gc__name="$(basename "${1}")"
@ -1064,9 +1068,6 @@ SPCD_BOX_RIGHT="╶"
SPCD_BOX_UP="╰" SPCD_BOX_UP="╰"
SPCD_BOX_VERTICAL="│" SPCD_BOX_VERTICAL="│"
SPCD_ERROR_CI=1
SPCD_ERROR_OS=2
SPCD_OS_ALMA="alma" SPCD_OS_ALMA="alma"
SPCD_OS_ALPINE="alpine" SPCD_OS_ALPINE="alpine"
SPCD_OS_ARCH="arch" SPCD_OS_ARCH="arch"
@ -1216,6 +1217,13 @@ spcd_banner_unset() {
SPCD_BANNER_BOTTOM SPCD_BANNER_BOTTOM
} }
# ╭──────────┬───────╮
# │ internal │ error │
# ╰──────────┴───────╯
SPCD_ERROR_CI=1
SPCD_ERROR_OS=2
# ╭──────────┬──────╮ # ╭──────────┬──────╮
# │ internal │ step │ # │ internal │ step │
# ╰──────────┴──────╯ # ╰──────────┴──────╯