|
@@ -181,10 +181,21 @@ fi
|
|
|
# Git Flow stuff
|
|
|
#
|
|
|
git-flow-release() {
|
|
|
- if [[ "${1}" != "" ]]; then
|
|
|
+ local version_next=""
|
|
|
+ if [[ "${1}" = "" ]]; then
|
|
|
+ local version_current="$(git lasttag 2>/dev/null)"
|
|
|
+ if [[ "${version_current}" != "" ]]; then
|
|
|
+ local version_minor="${version_current##*.}"
|
|
|
+ local version_major="${version_current%.*}"
|
|
|
+ local version_next="${version_major}.$((version_minor+1))"
|
|
|
+ fi
|
|
|
+ else
|
|
|
+ version_next="${1}"
|
|
|
+ fi
|
|
|
+ if [[ "${version_next}" != "" ]]; then
|
|
|
export GIT_MERGE_AUTOEDIT=no
|
|
|
- git flow release start "${1}" && \
|
|
|
- GIT_MERGE_AUTOEDIT=no git flow release finish -m "${1}" "${1}"
|
|
|
+ git flow release start "${version_next}" && \
|
|
|
+ GIT_MERGE_AUTOEDIT=no git flow release finish -m "${version_next}" "${version_next}"
|
|
|
else
|
|
|
printf "%s: tag is missing\n" "${0}" >&2
|
|
|
fi
|