Alter PEP440 handling to support both sem and cal

This commit is contained in:
Phil Jay
2023-04-27 08:31:46 +10:00
parent bb0e075f8b
commit f81c317cbd
5 changed files with 46 additions and 9 deletions

View File

@@ -16,8 +16,14 @@ pcre_old_calver='^(?P<major>0|[1-9]\d*)-0{0,1}(?P<minor>0|[0-9]\d*)-R(?P<patch>0
input_errors='false'
scheme="${scheme:-semver}"
if [[ "${scheme}" != 'semver' && "${scheme}" != 'calver' && "${scheme}" != 'pep440' ]] ; then
echo "🛑 Value of 'scheme' is not valid, choose from 'semver', 'calver', or 'pep440'" 1>&2
if [[ "${scheme}" != 'semver' && "${scheme}" != 'calver' ]] ; then
echo "🛑 Value of 'scheme' is not valid, choose from 'semver' or 'calver'" 1>&2
input_errors='true'
fi
pep440="${pep440:-false}"
if [[ "${pep440}" != 'false' && "${pep440}" != 'true' ]] ; then
echo "🛑 Value of 'pep440' is not valid, choose from 'false' or 'true'" 1>&2
input_errors='true'
fi