release: allow to specify version with the "v" prefix

The script currently fails if the version provided has the "v" prefix
(i.e., v3.6.0). Allow receiving the prefix and continue with the
process.

Signed-off-by: Ivan Valdes <ivan@vald.es>
This commit is contained in:
Ivan Valdes
2024-12-04 11:17:33 -08:00
parent 2b323071a8
commit e1e1787faf

View File

@ -48,8 +48,9 @@ help() {
}
main() {
VERSION=$1
if [[ ! "${VERSION}" =~ [0-9]+.[0-9]+.[0-9]+ ]]; then
# Allow to receive the version with the "v" prefix, i.e. v3.6.0.
VERSION=${1#v}
if [[ ! "${VERSION}" =~ ^[0-9]+.[0-9]+.[0-9]+ ]]; then
log_error "Expected 'version' param of the form '<major-version>.<minor-version>.<patch-version>' but got '${VERSION}'"
exit 1
fi