Skip to content

Commit 2e1d1c5

Browse files
committed
fix(gitutils): 🐛 update version retrieval
1 parent 510e87c commit 2e1d1c5

3 files changed

Lines changed: 12 additions & 6 deletions

File tree

src/gitutils/_git-release-beta.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if [ -f .git/RELEASE ] && [ -n "$(git branch --list release/* | grep -v $(cat .g
1010
fi
1111

1212
#### GET BUMP VERSION
13-
GBV=$(gitversion -config .gitversion -showvariable MajorMinorPatch | tee .git/RELEASE)
13+
GBV=$(gv -showvariable MajorMinorPatch | tee .git/RELEASE)
1414

1515
#### PREVENT GIT EDITOR PROMPT
1616
GIT_EDITOR=:

src/gitutils/_git-release-hotfix.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,23 @@
33
#### Goto repository root
44
cd "$(git rev-parse --show-toplevel)" >/dev/null
55

6-
#### GET last vX.Y.Z tag on the main branch
7-
last=$(git describe --tags --abbrev=0 --match "v[0-9]*.[0-9]*.[0-9]*" main | sed 's/^v//')
6+
# Parse arguments and print help if needed
7+
eval $(
8+
zz_args "Create HotFix branch" $0 "$@" <<-help
9+
help
10+
)
11+
12+
#### GET last vX.Y.Z tag on the main branch, removing the leading 'v' and replacing last number with 'X'
13+
current=$(git describe --tags --abbrev=0 --match "v[0-9]*.[0-9]*.[0-9]*" main | sed -e 's/^v//' -e 's/\.[0-9]*$/.X/')
814

915
#### SAVE CURRENT STATUS
10-
git stash save --include-untracked "Before hotfix/$last"
16+
git stash --include-untracked --message "Before $current" --keep-index
1117

1218
#### PREVENT GIT EDITOR PROMPT
1319
GIT_EDITOR=:
1420

1521
#### START HOTFIX
16-
git flow hotfix start $last
22+
git flow hotfix start $current
1723

1824
#### RESTORE STATUS
1925
git stash apply

src/gitutils/_git-release-prod.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ fi
4444
zz_log s "On branch: {Blue $flow/$name}"
4545

4646
# Get the new version from gitversion
47-
GBV=$(gitversion -config .gitversion -showvariable MajorMinorPatch)
47+
GBV=$(gv -showvariable MajorMinorPatch)
4848
if [ -z "$GBV" ]; then
4949
zz_log e "Cannot get version from .gitversion"
5050
exit 1

0 commit comments

Comments
 (0)