Skip to content

Commit e8e0f28

Browse files
tomgrvCopilot
andauthored
feat: support flexible naming
Co-authored-by: Copilot <[email protected]>
1 parent b2566d4 commit e8e0f28

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

update-version.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ update_version_file() {
2121
# Function to extract semver from git describe
2222
extract_semver_from_describe() {
2323
local describe_output="$1"
24-
# Extract version from patterns like:
24+
# Extract version from tags ending with a semantic version, e.g.:
2525
# feature_larasets_5.10.2-1-g97bdb34 -> 5.10.2-1-g97bdb34
26-
# feature_larasets_5.10.2 -> 5.10.2
27-
echo "$describe_output" | sed -E 's/^[^_]*_[^_]*_([0-9]+\.[0-9]+\.[0-9]+.*)/\1/' | head -1
26+
# release_5.10.2 -> 5.10.2
27+
# v5.10.2 -> 5.10.2
28+
# The regex matches any tag ending with X.Y.Z (optionally with suffixes).
29+
echo "$describe_output" | sed -E 's/.*[_v]([0-9]+\.[0-9]+\.[0-9]+([-a-zA-Z0-9\.]*)?)/\1/' | head -1
2830
}
2931

3032
# Try GitVersion first (if available and working)

0 commit comments

Comments
 (0)