[squash] POSIX logic for tag detection

This never actually got executed in tests but the old logic only works
in bash. Follow-up to #27
This commit is contained in:
crystal 2024-04-28 23:32:13 -06:00
parent d0dfedd50f
commit 804f3bef24
No known key found for this signature in database
GPG key ID: 1122054731F7CC43

View file

@ -97,13 +97,13 @@ case "$1" in
git describe --tags HEAD
CI_COMMIT_TAG_RESOLVE=$(git describe --tags HEAD --abbrev=0)
echo "Closest existing tag: $CI_COMMIT_TAG_RESOLVE"
if [ "$CI_COMMIT_TAG_RESOLVE" = *"-dev" ] ; then
if [ "$CI_COMMIT_TAG_RESOLVE" != "${CI_COMMIT_TAG_RESOLVE%"-dev"}" ] || [ ! "$CI_COMMIT_TAG_RESOLVE" ] ; then
if [ $PR_MODE ] ; then
echo "I can't figure out which release version of Forgejo to build your PR against."
echo "Whatever you're trying to do is not yet implemented."
exit 97
fi
echo "err! building dev version- skipping binary dl"
echo "err! unable to resolve tag or building dev version- skipping binary dl"
CI_COMMIT_TAG_RESOLVE=
fi
fi