Skip to content

Commit fc2bcc4

Browse files
committed
Handle multi-digit version components
1 parent 8b1db95 commit fc2bcc4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

hooks/pre-push

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/bin/sh
22

33
if [ "$(git branch --show-current)" = master ]; then
4-
VERSION="v$(grep -oP '^__version__ = "\K\d(\.\d){2}' cmake-init/__main__.py)"
4+
MAIN=cmake-init/__main__.py
5+
VERSION="v$(grep -oP '^__version__ = "\K\d(\.\d+){2}' "${MAIN}")"
56
if [ -n "$(git ls-remote --tags origin "${VERSION}")" ]; then
67
echo "${VERSION} already exists remotely, bump the version" >&2
78
exit 1

0 commit comments

Comments
 (0)