From 1655caad6cb440f80e3fd9f0c599330685616f3b Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Mon, 30 Oct 2023 05:12:19 +0100 Subject: [PATCH] Clean up shell scripts --- scripts/aur.sh | 9 +++------ scripts/test.sh | 4 ++-- scripts/update.sh | 6 ++---- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/scripts/aur.sh b/scripts/aur.sh index 8cc67df..c808d34 100644 --- a/scripts/aur.sh +++ b/scripts/aur.sh @@ -10,20 +10,17 @@ aur_clone="/tmp/aur-${name}" if [[ "${name}" = '' ]] then - echo 'The package name must be specified as the first argument' - exit 1 + error 'The package name must be specified as the first argument' fi if [[ "${version}" = '' ]] then - echo 'The version must be specified as the second argument' - exit 1 + error 'The version must be specified as the second argument' fi if [[ "${ssh_key}" = '' ]] then - echo 'The SSH private key must be specified as the third argument' - exit 1 + error 'The SSH private key must be specified as the third argument' fi if [[ -v CI ]] diff --git a/scripts/test.sh b/scripts/test.sh index 550cb56..cc2082f 100644 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -1,13 +1,13 @@ #!/usr/bin/env bash set -e +source ./scripts/setup.sh name="${1}" if [[ "${name}" = '' ]] then - echo 'The package name must be specified as the first argument' - exit 1 + error 'The package name must be specified as the first argument' fi cd "${name}" diff --git a/scripts/update.sh b/scripts/update.sh index 64f8e6c..7606489 100644 --- a/scripts/update.sh +++ b/scripts/update.sh @@ -8,14 +8,12 @@ version="${2}" if [[ "${name}" = '' ]] then - echo 'The package name must be specified as the first argument' - exit 1 + error 'The package name must be specified as the first argument' fi if [[ "${version}" = '' ]] then - echo 'The version must be specified as the second argument' - exit 1 + error 'The version must be specified as the second argument' fi cd "${name}"