Skip to content

Commit 3541476

Browse files
authored
Fix make targets on Windows (#2659)
1 parent 9bc0db9 commit 3541476

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

Makefile

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# All documents to be used in spell check.
2-
ALL_DOCS := $(shell find . -type f -name '*.md' -not -path './.github/*' -not -path './node_modules/*' | sort)
31
PWD := $(shell pwd)
42

53
# Determine OS & Arch for specific OS only tools on Unix based systems
@@ -90,11 +88,11 @@ $(MISSPELL):
9088

9189
.PHONY: misspell
9290
misspell: $(MISSPELL)
93-
$(MISSPELL) -error $(ALL_DOCS)
91+
find . -type f -name '*.md' -not -path './.github/*' -not -path './node_modules/*' -not -path './.git/*' -exec $(MISSPELL) -error {} +
9492

9593
.PHONY: misspell-correction
9694
misspell-correction: $(MISSPELL)
97-
$(MISSPELL) -w $(ALL_DOCS)
95+
find . -type f -name '*.md' -not -path './.github/*' -not -path './node_modules/*' -not -path './.git/*' -exec $(MISSPELL) -w {} +
9896

9997
.PHONY: normalized-link-check
10098
# NOTE: Search "model/*/**" rather than "model" to skip `model/README.md`, which
@@ -127,21 +125,21 @@ markdown-link-check-local-only: normalized-link-check
127125
.PHONY: markdown-toc
128126
markdown-toc:
129127
@if ! npm ls markdown-toc; then npm install; fi
130-
@for f in $(ALL_DOCS); do \
131-
if grep -q '<!-- tocstop -->' $$f; then \
132-
echo markdown-toc: processing $$f; \
133-
npx --no -- markdown-toc --bullets "-" --no-first-h1 --no-stripHeadingTags -i $$f || exit 1; \
134-
elif grep -q '<!-- toc -->' $$f; then \
135-
echo markdown-toc: ERROR: '<!-- tocstop -->' missing from $$f; exit 1; \
128+
@find . -type f -name '*.md' -not -path './.github/*' -not -path './node_modules/*' -not -path './.git/*' | while read -r f; do \
129+
if grep -q '<!-- tocstop -->' "$$f"; then \
130+
echo markdown-toc: processing "$$f"; \
131+
npx --no -- markdown-toc --bullets "-" --no-first-h1 --no-stripHeadingTags -i "$$f" || exit 1; \
132+
elif grep -q '<!-- toc -->' "$$f"; then \
133+
echo markdown-toc: ERROR: '<!-- tocstop -->' missing from "$$f"; exit 1; \
136134
else \
137-
echo markdown-toc: no TOC markers, skipping $$f; \
135+
echo markdown-toc: no TOC markers, skipping "$$f"; \
138136
fi; \
139137
done
140138

141139
.PHONY: markdownlint
142140
markdownlint:
143141
@if ! npm ls markdownlint-cli; then npm install; fi
144-
npx --no -- markdownlint-cli -c .markdownlint.yaml $(ALL_DOCS)
142+
npx --no -- markdownlint-cli -c .markdownlint.yaml "**/*.md" --ignore ./.github/ --ignore ./node_modules/ --ignore ./.git/
145143

146144
.PHONY: install-yamllint
147145
install-yamllint:

0 commit comments

Comments
 (0)