File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -141,13 +141,21 @@ endif
141141open_cov :
142142 (( open "$(COV_INDEX_FILE)" || xdg- open "$(COV_INDEX_FILE)") &> / dev/ null) &
143143
144+ # Check all files and error if any ToC were modified.
144145check_toc : $(MARKDOWN_FILES:=.toc )
146+ @[ " $$ (find . -name '*.md.tmp' -print -quit)" ] && exit 1 || exit 0
145147
148+ # Generate ToC sections & save copy of original if modified.
146149% .toc :
147- cp $* $* .tmp && \
148- doctoc $* && \
149- diff -q $* $* .tmp && \
150- rm $* .tmp
150+ @cp $* $* .tmp; \
151+ doctoc $* > /dev/null; \
152+ if diff -q $* $* .tmp > /dev/null; then \
153+ echo " Good $* " ; \
154+ rm $* .tmp; \
155+ else \
156+ echo " \033[1;33m Bad $* \033[0m" ; \
157+ echo " \033[1;34m See $* .tmp\033[0m" ; \
158+ fi
151159
152160codespell :
153161 codespell . --skip " ./.git,./venv,$( PY_SPEC_DIR) /.mypy_cache" -I .codespell-whitelist
You can’t perform that action at this time.
0 commit comments