Skip to content

Commit 6c226ca

Browse files
streamline getting current version in script
1 parent f564126 commit 6c226ca

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

scripts/version_bump.sh

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
set -e
33

44
BRANCH="${1}"
5-
echo "Processing branch: $BRANCH"
5+
CURRENT=$(bump-my-version show current_version)
6+
7+
echo "Processing branch: $BRANCH (current: $CURRENT)"
68

79
ALREADY_COMMITTED=false
810
PUBLISH=false # Default: most branches don't publish
@@ -15,8 +17,6 @@ case "$BRANCH" in
1517

1618
release/*)
1719
echo "🎯 Bumping release"
18-
CURRENT=$(bump-my-version show current_version)
19-
2020
if [[ "$CURRENT" == *"a"* ]]; then
2121
echo " Alpha → RC1"
2222
bump-my-version bump pre_label
@@ -38,8 +38,6 @@ case "$BRANCH" in
3838

3939
main)
4040
echo "🎉 Main branch"
41-
CURRENT=$(bump-my-version show current_version)
42-
4341
if [[ "$CURRENT" =~ (rc|a) ]]; then
4442
echo " Stripping pre-release label"
4543
bump-my-version bump pre_label
@@ -50,12 +48,11 @@ case "$BRANCH" in
5048

5149
hotfix/*)
5250
echo "🔧 Bumping hotfix patch"
53-
CURRENT=$(bump-my-version show current_version)
5451
[[ "$CURRENT" =~ (rc|a) ]] && bump-my-version bump pre_label
5552
bump-my-version bump patch
5653
;;
5754

58-
feature/*|issue/*|docs/*|*)
55+
*)
5956
echo "🌟 Branch: no version bump"
6057
;;
6158
esac

0 commit comments

Comments
 (0)