build: fix the preview mode for release tool

This commit is contained in:
Cotes Chung 2022-06-09 15:01:27 +08:00
parent fd0f983bbe
commit 7f18cdc1fd
No known key found for this signature in database
GPG key ID: 0D9E54843167A808

View file

@ -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