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