Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 67a8948

Browse filesBrowse files
committed
fix: ensure patch version numbers exist
1 parent e0bde33 commit 67a8948
Copy full SHA for 67a8948

File tree

1 file changed

+8
-3
lines changed
Filter options

1 file changed

+8
-3
lines changed

‎scripts/update_tags_and_docs.sh

Copy file name to clipboardExpand all lines: scripts/update_tags_and_docs.sh
+8-3Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,14 @@ echo "Extracted version: ${BOOKSTACK_VERSION}"
1616
# Remove the 'v' for our tags
1717
BOOKSTACK_VERSION="${BOOKSTACK_VERSION/#v/}"
1818
# Remove leading zeros to make the version fit a SemVer-shaped hole
19-
BOOKSTACK_VERSION="${BOOKSTACK_VERSION/.0/.}"
20-
# And again for patch version, just in case
21-
BOOKSTACK_VERSION="${BOOKSTACK_VERSION/.0/.}"
19+
BOOKSTACK_VERSION="${BOOKSTACK_VERSION//.0?/.}"
20+
21+
# If the version only has one decimal dot in it, it doesn't have a patch
22+
# version and one should be added to ensure semver-shape.
23+
BS_DECIMALS="${BOOKSTACK_VERSION//[^.]}"
24+
if [[ "${#BS_DECIMALS}" -eq "1" ]]; then
25+
BOOKSTACK_VERSION="${BOOKSTACK_VERSION}.0"
26+
fi
2227

2328
echo "Tag name: ${BOOKSTACK_VERSION}"
2429

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.