tools: Fix substring matching in bump script

pull/146/head
Jeremy Rand 3 years ago
parent 9c43eee9b6
commit 6be691ac66
No known key found for this signature in database
GPG Key ID: EB03139A459DD06E

@ -74,7 +74,11 @@ do
LATEST_INFO=$(git ls-remote "${GIT_URL}" HEAD ${LATEST_TAG} ${LATEST_TAG}^{})
PROJECT_UPDATE_NEEDED=0
echo "${LATEST_INFO}" | grep ${GIT_REV} > /dev/null || PROJECT_UPDATE_NEEDED=1
# Search for the Git rev, either as a tag between a slash and the end of a
# line, a tag between a slash and ^{}, or a hash between the start of a
# line and whitespace. Prevent substring matches e.g. matching v0.2.2 when
# searching for v0.2.
echo "${LATEST_INFO}" | grep -E '(^|\/)'${GIT_REV}'((\^\{\})?$|\s)' > /dev/null || PROJECT_UPDATE_NEEDED=1
if [ "${PROJECT_UPDATE_NEEDED}" = 1 ]
then
UPDATE_NEEDED=1

Loading…
Cancel
Save