Skip to content

Commit

Permalink
fix: ensure patch version numbers exist
Browse files Browse the repository at this point in the history
  • Loading branch information
rjhenry committed Dec 23, 2024
1 parent e0bde33 commit 67a8948
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions scripts/update_tags_and_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,14 @@ echo "Extracted version: ${BOOKSTACK_VERSION}"
# Remove the 'v' for our tags
BOOKSTACK_VERSION="${BOOKSTACK_VERSION/#v/}"
# Remove leading zeros to make the version fit a SemVer-shaped hole
BOOKSTACK_VERSION="${BOOKSTACK_VERSION/.0/.}"
# And again for patch version, just in case
BOOKSTACK_VERSION="${BOOKSTACK_VERSION/.0/.}"
BOOKSTACK_VERSION="${BOOKSTACK_VERSION//.0?/.}"

# If the version only has one decimal dot in it, it doesn't have a patch
# version and one should be added to ensure semver-shape.
BS_DECIMALS="${BOOKSTACK_VERSION//[^.]}"
if [[ "${#BS_DECIMALS}" -eq "1" ]]; then
BOOKSTACK_VERSION="${BOOKSTACK_VERSION}.0"
fi

echo "Tag name: ${BOOKSTACK_VERSION}"

Expand Down

0 comments on commit 67a8948

Please sign in to comment.