3
0

Nicer warning for docs gen makefile task

This commit is contained in:
Denis Arh
2022-04-24 09:16:35 +02:00
parent ac35d569a3
commit a5753645f5
2 changed files with 8 additions and 1 deletions

View File

@@ -82,6 +82,7 @@ clean-corteza-tools:
########################################################################################################################
COLOUR_GREEN=\033[0;32m
COLOUR_YELLOW=\033[0;33m
COLOUR_RED=\033[0;31m
COLOUR_BLUE=\033[0;34m
COLOUR_END=\033[0m

View File

@@ -14,7 +14,13 @@ $(DEF_SERVER): $(CUE) $(JSONTPLEXEC)
@ echo "$(COLOUR_GREEN)Generating server files from $@$(COLOUR_END)"
@ $(CUE) eval $@ --out json | $(JSONTPLEXEC) -v -p $(ROOT_DIR)/codegen/assets/templates -b $(ROOT_DIR)
ifeq ("${DOCS_DIR}", "")
$(DEF_DOCS):
@ echo "$(COLOUR_YELLOW)Skipping docs generation: DOCS_DIR is not set.$(COLOUR_END)"
@ echo "$Run task like this: make "$@" DOCS_DIR=/path/to/corteza-docs"
@ echo ""
else
$(DEF_DOCS): $(CUE) $(JSONTPLEXEC)
@[ "${DOCS_DIR}" ] || ( echo "DOCS_DIR is not set, run make like this: make docs DOCS_DIR=/path/to/corteza-docs"; exit 1 )
@ echo "$(COLOUR_GREEN)Generating doc files from $@$(COLOUR_END) $(COLOUR_BLUE)(dst: $(DOCS_DIR))$(COLOUR_END)"
@ $(CUE) eval $@ --out json | $(JSONTPLEXEC) -v -p $(ROOT_DIR)/codegen/assets/templates -b $(DOCS_DIR)
endif