From 82f2b241b2a9e97e6a771b40cea9079bcc42855b Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 25 Aug 2024 19:18:43 +0200 Subject: [PATCH] spcd/error --- spcd/main.sh | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/spcd/main.sh b/spcd/main.sh index 6537eee..a76c3aa 100644 --- a/spcd/main.sh +++ b/spcd/main.sh @@ -870,6 +870,22 @@ ${SPCD_PYTHON_ALIAS} / ${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 │ # ╰───────────┴──────╯ @@ -918,18 +934,6 @@ spcd_echo() { 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() { if [ -n "${1}" ]; then spcd_gc__name="$(basename "${1}")" @@ -1064,9 +1068,6 @@ SPCD_BOX_RIGHT="╶" SPCD_BOX_UP="╰" SPCD_BOX_VERTICAL="│" -SPCD_ERROR_CI=1 -SPCD_ERROR_OS=2 - SPCD_OS_ALMA="alma" SPCD_OS_ALPINE="alpine" SPCD_OS_ARCH="arch" @@ -1216,6 +1217,13 @@ spcd_banner_unset() { SPCD_BANNER_BOTTOM } +# ╭──────────┬───────╮ +# │ internal │ error │ +# ╰──────────┴───────╯ + +SPCD_ERROR_CI=1 +SPCD_ERROR_OS=2 + # ╭──────────┬──────╮ # │ internal │ step │ # ╰──────────┴──────╯