Skip to content

Commit 359ba16

Browse files
committed
Shellcheck: SC2181 Check exit code directly
1 parent 5380d0f commit 359ba16

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

test-build.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,8 @@ for version in "${versions[@]}"; do
3131
tag=$(cat $version/Dockerfile | grep "ENV NODE_VERSION" | cut -d' ' -f3)
3232

3333
info "Building $tag..."
34-
docker build -t node:$tag $version
3534

36-
if [[ $? -gt 0 ]]; then
35+
if ! docker build -t node:$tag $version; then
3736
fatal "Build of $tag failed!"
3837
else
3938
info "Build of $tag succeeded."
@@ -53,9 +52,8 @@ for version in "${versions[@]}"; do
5352
[ -f "$version/$variant/Dockerfile" ] || continue
5453

5554
info "Building $tag-$variant variant..."
56-
docker build -t node:$tag-$variant $version/$variant
5755

58-
if [[ $? -gt 0 ]]; then
56+
if ! docker build -t node:$tag-$variant $version/$variant; then
5957
fatal "Build of $tag-$variant failed!"
6058
else
6159
info "Build of $tag-$variant succeeded."

0 commit comments

Comments
 (0)