~kp/git-release

4a045894fe9f63942c0f8afebc00c3237ae1586a — Konstantinos Pachnis 6 years ago aa909ab
Update RegEx to support versioning of the form xxx.xxx.xxx
1 files changed, 3 insertions(+), 3 deletions(-)

M git-release
M git-release => git-release +3 -3
@@ 41,7 41,7 @@ usage() {
create_release_number() {
	checks

	if echo "$version_no" | grep [0-9].[0-9].[0-9] >/dev/null; then
	if echo "$version_no" | egrep "^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$" >/dev/null; then
		remotes="$(git remote)"

		git tag -s "$version_no" -m "Create version $version_no"


@@ 97,7 97,7 @@ auto_release_number() {

	local version="$(git tag -l | sort -n -r -t. -k1,1 -k2,2 -k3,3 | head -n 1)"

	if echo "$version" | grep [0-9].[0-9].[0-9] >/dev/null; then
	if echo "$version" | egrep "^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$" >/dev/null; then
		case $version_type in
			'major')
				version_no="$(echo $version | awk -F . '{ print $1+1 "." 0 "." 0 }')"


@@ 157,7 157,7 @@ delete_release_number() {

	checks

	if ! echo "$version_no" | grep [0-9].[0-9].[0-9] >/dev/null; then
	if ! echo "$version_no" | egrep "^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$" >/dev/null; then
		printf "Release $version_no not found\n"
		exit $EPERM
	fi