Merge pull request #788 from bgilbert/patch-1

tag_release: fix version validation when bumping patch on branch
This commit is contained in:
Benjamin Gilbert 2018-02-03 10:34:08 -08:00 committed by GitHub
commit e0b2e7e043
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -68,8 +68,11 @@ if [[ ${FLAGS_branch} -eq ${FLAGS_TRUE} ]]; then
if [[ ${FLAGS_major} -ne ${CURRENT_VERSION[0]} ]]; then
die_notrace "Branch major should be ${CURRENT_VERSION[0]}"
fi
if [[ ${FLAGS_minor} -le ${CURRENT_VERSION[1]} ]]; then
die_notrace "Branch minor should be greater than ${CURRENT_VERSION[1]}"
if [[ ${FLAGS_minor} -lt ${CURRENT_VERSION[1]} ]]; then
die_notrace "Branch minor should be at least ${CURRENT_VERSION[1]}"
fi
if [[ ${FLAGS_minor} -eq ${CURRENT_VERSION[1]} && ${FLAGS_patch} -le ${CURRENT_VERSION[2]} ]]; then
die_notrace "With minor ${FLAGS_minor}, branch patch should be greater than ${CURRENT_VERSION[2]}"
fi
fi