From 627411e99979f6d155f8fcb733c904eb6dc0b034 Mon Sep 17 00:00:00 2001 From: Nils Freydank Date: Sun, 1 Oct 2023 18:50:24 +0200 Subject: [PATCH] Create function for basic error handling (Yes, it might be a little bit inspired by the on used in Gentoo..) --- build-image.sh | 6 ++++++ build-packages.sh | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/build-image.sh b/build-image.sh index 234c0eb..cdb6432 100755 --- a/build-image.sh +++ b/build-image.sh @@ -43,6 +43,12 @@ PODMAN_BUILD_ARGS=( --no-cache ) +exit_err() +{ + echo "${@}" + exit -1 +} + mkdir -p "${REPOS}" mkdir -p "${DISTFILES}" mkdir -p "${BINPKG}" diff --git a/build-packages.sh b/build-packages.sh index c6188a5..fd8f1d3 100755 --- a/build-packages.sh +++ b/build-packages.sh @@ -39,6 +39,12 @@ PODMAN_BUILD_ARGS=( -v "${LOGDIR}:/var/log:rw,U" ) +exit_err() +{ + echo "${@}" + exit -1 +} + mkdir -p "${REPOS}" mkdir -p "${DISTFILES}" mkdir -p "${BINPKG}"