From 4ce89f9209e3bced50d137696ad16f7e6489bbfb Mon Sep 17 00:00:00 2001 From: Tobias Genannt Date: Wed, 15 Mar 2023 13:01:07 +0100 Subject: [PATCH] Added check for commands to all scripts --- build-functions/check-commands.sh | 9 +++++++++ build-latest.sh | 4 ++++ build.sh | 9 ++------- 3 files changed, 15 insertions(+), 7 deletions(-) create mode 100644 build-functions/check-commands.sh diff --git a/build-functions/check-commands.sh b/build-functions/check-commands.sh new file mode 100644 index 0000000..e998490 --- /dev/null +++ b/build-functions/check-commands.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +NEEDED_COMMANDS="curl jq docker skopeo" +for c in $NEEDED_COMMANDS; do + if ! command -v "$c" &>/dev/null; then + echo "⚠️ '$c' is not installed. Can't proceed with build." + exit 1 + fi +done diff --git a/build-latest.sh b/build-latest.sh index ec4cc24..0cc6c38 100755 --- a/build-latest.sh +++ b/build-latest.sh @@ -1,5 +1,9 @@ #!/bin/bash # Builds the latest released version + +# Check if we have everything needed for the build +source ./build-functions/check-commands.sh + source ./build-functions/gh-functions.sh echo "▶️ $0 $*" diff --git a/build.sh b/build.sh index 5e63394..6d79160 100755 --- a/build.sh +++ b/build.sh @@ -137,13 +137,8 @@ END_OF_HELP fi fi -NEEDED_COMMANDS="curl jq docker skopeo" -for c in $NEEDED_COMMANDS; do - if ! command -v "$c" &>/dev/null; then - echo "⚠️ '$c' is not installed. Can't proceed with build." - exit 1 - fi -done +# Check if we have everything needed for the build +source ./build-functions/check-commands.sh source ./build-functions/gh-functions.sh