From: Christian Heller Date: Tue, 25 Mar 2025 16:10:36 +0000 (+0100) Subject: Minor refactoring. X-Git-Url: https://plomlompom.com/repos/%22https:/validator.w3.org/process_titles?a=commitdiff_plain;h=d360a92c5b0b55c19174890fddfe380a649a0dc5;p=config Minor refactoring. --- diff --git a/testing/scripts/_config_scripts_lib.sh b/testing/scripts/_config_scripts_lib.sh index 2594682..62f9fcc 100644 --- a/testing/scripts/_config_scripts_lib.sh +++ b/testing/scripts/_config_scripts_lib.sh @@ -18,23 +18,25 @@ expect_min_n_args() { fi } +_abort() { + echo "Aborting: $1" + exit 1 +} + abort_if_exists() { if [ -e "$1" ]; then - echo "Aborting because $1 already exists." - exit 1 + _abort "$1 already exists." fi } abort_if_not_user() { if [ "$(whoami)" != "$1" ]; then - echo "Must be run as ${1}." - exit 1 + _abort "Must be run as ${1}." fi } abort_if_offline() { if ! ping -c1 -W2 1.1.1.1 > /dev/null 2>&1; then - echo "Must be run online." - exit 1 + _abort 'Must be run online.' fi }