Skip to content

Commit 6f23f62

Browse files
committed
Print more helpful error message if version tag is missing
1 parent 8cca180 commit 6f23f62

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

installer-downloader/build.sh

+9-1
Original file line numberDiff line numberDiff line change
@@ -371,10 +371,18 @@ function verify_version_tag {
371371
log_info "Current commit must have tag: $expect_tag"
372372

373373
local tag
374+
set +e
374375
tag=$(git describe --exact-match --tags)
376+
local describe_exit=$?
377+
set -e
378+
379+
if [[ $describe_exit -ne 0 ]]; then
380+
log_error "'git describe' failed for the current commit (no tag?). Expected tag $expect_tag"
381+
exit 1
382+
fi
375383

376384
if [[ "$tag" != "$expect_tag" ]]; then
377-
log_error "Tag not found for current commit. Expected $expect_tag. Found: $tag"
385+
log_error "Unexpected tag found for current commit. Expected $expect_tag. Found: $tag"
378386
exit 1
379387
fi
380388

0 commit comments

Comments
 (0)