build: add one more version check

This commit is contained in:
Daylin Morgan 2023-01-20 12:45:36 -06:00
parent e32279d494
commit 8cc34dbcde

View file

@ -44,8 +44,10 @@ c clean: ## remove the generated files
@rm -f task.mk .task.mk @rm -f task.mk .task.mk
define version_check_sh define version_check_sh
if [[ "${VERSION}" == *'-'* ]]; then if git rev-parse -q --verify "refs/tags/${VERSION}" >/dev/null; then
$(call tprint-verbose,{a.red}VERSION INVALID!{a.end} Uncommited or untagged work) $(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 exit 1
elif [[ $(shell echo "${VERSION}" | awk -F. '{ print NF }') -lt 3 ]];then\ elif [[ $(shell echo "${VERSION}" | awk -F. '{ print NF }') -lt 3 ]];then\
$(call tprint-verbose,{a.red}VERSION INVALID!{a.end} Expected CalVer string) $(call tprint-verbose,{a.red}VERSION INVALID!{a.end} Expected CalVer string)