Skip to content

Commit 4ce89f9

Browse files
committed
Added check for commands to all scripts
1 parent 4bad061 commit 4ce89f9

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

build-functions/check-commands.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
NEEDED_COMMANDS="curl jq docker skopeo"
4+
for c in $NEEDED_COMMANDS; do
5+
if ! command -v "$c" &>/dev/null; then
6+
echo "⚠️ '$c' is not installed. Can't proceed with build."
7+
exit 1
8+
fi
9+
done

build-latest.sh

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#!/bin/bash
22
# Builds the latest released version
3+
4+
# Check if we have everything needed for the build
5+
source ./build-functions/check-commands.sh
6+
37
source ./build-functions/gh-functions.sh
48

59
echo "▶️ $0 $*"

build.sh

+2-7
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,8 @@ END_OF_HELP
137137
fi
138138
fi
139139

140-
NEEDED_COMMANDS="curl jq docker skopeo"
141-
for c in $NEEDED_COMMANDS; do
142-
if ! command -v "$c" &>/dev/null; then
143-
echo "⚠️ '$c' is not installed. Can't proceed with build."
144-
exit 1
145-
fi
146-
done
140+
# Check if we have everything needed for the build
141+
source ./build-functions/check-commands.sh
147142

148143
source ./build-functions/gh-functions.sh
149144

0 commit comments

Comments
 (0)