From 8cc34dbcdecb392894aae7c600bafe56ae715369 Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Fri, 20 Jan 2023 12:45:36 -0600 Subject: [PATCH] build: add one more version check --- Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index d2ec1f6..d350620 100644 --- a/Makefile +++ b/Makefile @@ -44,8 +44,10 @@ c clean: ## remove the generated files @rm -f task.mk .task.mk define version_check_sh -if [[ "${VERSION}" == *'-'* ]]; then - $(call tprint-verbose,{a.red}VERSION INVALID!{a.end} Uncommited or untagged work) +if git rev-parse -q --verify "refs/tags/${VERSION}" >/dev/null; then + $(call tprint-verbose,{a.red}VERSION INVALID!{a.end} tag already exists); exit 1; +elif [[ "${VERSION}" == *'-'* ]]; then + $(call tprint-verbose,{a.red}VERSION INVALID!{a.end} Uncommited or untagged work); exit 1; exit 1 elif [[ $(shell echo "${VERSION}" | awk -F. '{ print NF }') -lt 3 ]];then\ $(call tprint-verbose,{a.red}VERSION INVALID!{a.end} Expected CalVer string)