make: fix validate-docs (#1376)

This commit is contained in:
Dominik Menke 2021-03-17 02:27:37 +01:00 committed by GitHub
parent 60f7cb0598
commit ee0b4bd0b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -72,10 +72,12 @@ generate-dns:
go generate ./... go generate ./...
validate-doc: generate-dns validate-doc: generate-dns
ifneq ($(shell git status --porcelain -- ./docs/ ./cmd/ 2>/dev/null),) validate-doc: DOC_DIRECTORIES := ./docs/ ./cmd/
@echo 'The documentation must be regenerated, please use `make generate-dns`.' validate-doc:
@git status --porcelain -- ./docs/ ./cmd/ 2>/dev/null if git diff --exit-code --quiet $(DOC_DIRECTORIES) 2>/dev/null; then \
@exit 2 echo 'All documentation changes are done the right way.'; \
else else \
@echo 'All documentation changes are done the right way.' echo 'The documentation must be regenerated, please use `make generate-dns`.'; \
endif git status --porcelain -- $(DOC_DIRECTORIES) 2>/dev/null; \
exit 2; \
fi