Improve the bump tool

This commit is contained in:
Cotes Chung 2021-08-09 13:17:29 +08:00
parent 03248f5bff
commit 9d9bca5e3b
1 changed files with 9 additions and 13 deletions

View File

@ -123,19 +123,15 @@ release() {
_release_branch="$_major-$_minor-stable" _release_branch="$_major-$_minor-stable"
if $opt_manual; then if ! $opt_manual; then
echo -e "Bump version to $_version (manual release)\n" if [[ -z $(git branch -v | grep "$_release_branch") ]]; then
bump "$_version" git checkout -b "$_release_branch"
exit 0 _new_release_branch=true
fi else
git checkout "$_release_branch"
if [[ -z $(git branch -v | grep "$_release_branch") ]]; then # cherry-pick the latest commit from master branch to release branch
git checkout -b "$_release_branch" git cherry-pick "$(git rev-parse $DEFAULT_BRANCH)"
_new_release_branch=true fi
else
git checkout "$_release_branch"
# cherry-pick the latest commit from master branch to release branch
git cherry-pick "$(git rev-parse $DEFAULT_BRANCH)"
fi fi
echo -e "Bump version to $_version\n" echo -e "Bump version to $_version\n"