Skip to content

Commit 67a8948

Browse files
committed
fix: ensure patch version numbers exist
1 parent e0bde33 commit 67a8948

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Diff for: scripts/update_tags_and_docs.sh

+8-3
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)