Skip to content

Commit 7f18cdc

Browse files
committed
build: fix the preview mode for release tool
1 parent fd0f983 commit 7f18cdc

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

tools/release.sh

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -184,20 +184,13 @@ build_gem() {
184184
release() {
185185
_version="$1" # X.Y.Z
186186

187-
if $opt_pre; then
188-
$opt_pre
189-
exit 0
190-
fi
191-
192187
git checkout "$PROD_BRANCH"
193188
git merge --no-ff --no-edit "$working_branch"
194189

195190
# Create a new tag on production branch
196191
echo -e "Create tag v$_version\n"
197192
git tag "v$_version"
198193

199-
build_gem
200-
201194
# merge from patch branch to the staging branch
202195
# NOTE: This may break due to merge conflicts, so it may need to be resolved manually.
203196
if [[ $working_branch == hotfix/* ]]; then
@@ -224,11 +217,14 @@ main() {
224217
echo -e "Bump version number to $_version\n"
225218
bump "$_version"
226219

227-
release "$_version"
228-
229-
# Undo all changes on Git
230-
$opt_pre && git reset --hard && git clean -fd
220+
build_gem
231221

222+
if [[ $opt_pre = true ]]; then
223+
# Undo all changes on Git
224+
git reset --hard && git clean -fd
225+
else
226+
release "$_version"
227+
fi
232228
}
233229

234230
while (($#)); do

0 commit comments

Comments
 (0)