From 7f18cdc1fd4281aac93c355ee8bdcd209980115e Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Thu, 9 Jun 2022 15:01:27 +0800 Subject: [PATCH] build: fix the `preview` mode for release tool --- tools/release.sh | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/tools/release.sh b/tools/release.sh index 2b55218..762cae7 100755 --- a/tools/release.sh +++ b/tools/release.sh @@ -184,11 +184,6 @@ build_gem() { release() { _version="$1" # X.Y.Z - if $opt_pre; then - $opt_pre - exit 0 - fi - git checkout "$PROD_BRANCH" git merge --no-ff --no-edit "$working_branch" @@ -196,8 +191,6 @@ release() { echo -e "Create tag v$_version\n" git tag "v$_version" - build_gem - # merge from patch branch to the staging branch # NOTE: This may break due to merge conflicts, so it may need to be resolved manually. if [[ $working_branch == hotfix/* ]]; then @@ -224,11 +217,14 @@ main() { echo -e "Bump version number to $_version\n" bump "$_version" - release "$_version" - - # Undo all changes on Git - $opt_pre && git reset --hard && git clean -fd + build_gem + if [[ $opt_pre = true ]]; then + # Undo all changes on Git + git reset --hard && git clean -fd + else + release "$_version" + fi } while (($#)); do