make: fix bump target version parsing
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful

The heredoc-based read broke across make's per-line recipe handling. Parse the
current version with cut in a single backslash-continued shell instead, and
error on an unknown PART.
This commit is contained in:
2026-07-17 23:30:36 +10:00
parent c1795a2739
commit fa6db89f0d
+6 -4
View File
@@ -39,14 +39,16 @@ minor: ; @$(MAKE) bump PART=minor
major: ; @$(MAKE) bump PART=major
bump:
@cur=$$(git describe --tags --abbrev=0 2>/dev/null | sed 's/^v//' || echo 0.0.0); \
IFS=. read -r MA MI PA <<EOF
$$cur
EOF
@cur=$$(git describe --tags --abbrev=0 2>/dev/null | sed 's/^v//'); \
[ -n "$$cur" ] || cur=0.0.0; \
MA=$$(echo "$$cur" | cut -d. -f1); \
MI=$$(echo "$$cur" | cut -d. -f2); \
PA=$$(echo "$$cur" | cut -d. -f3); \
case "$(PART)" in \
major) MA=$$((MA+1)); MI=0; PA=0;; \
minor) MI=$$((MI+1)); PA=0;; \
patch) PA=$$((PA+1));; \
*) echo "unknown PART=$(PART)"; exit 1;; \
esac; \
new="v$$MA.$$MI.$$PA"; \
echo "tagging $$new"; \