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