Skip to content

Commit

Permalink
Use --no-install option for npx
Browse files Browse the repository at this point in the history
  • Loading branch information
chalin committed Feb 8, 2022
1 parent 85b6d5d commit 7f194d1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ misspell-correction: $(MISSPELL)

.PHONY: markdown-link-check
markdown-link-check:
@for f in $(ALL_DOCS); do npx markdown-link-check --quiet --config .markdown_link_check_config.json $$f; done
@for f in $(ALL_DOCS); do \
npx --no -- markdown-link-check --quiet --config .markdown_link_check_config.json $$f \
|| exit 1; \
done

# This target runs markdown-toc on all files that contain
# a comment <!-- tocstop -->.
Expand All @@ -38,16 +41,19 @@ markdown-toc:
@for f in $(ALL_DOCS); do \
if grep -q '<!-- tocstop -->' $$f; then \
echo markdown-toc: processing $$f; \
npx markdown-toc --no-first-h1 -i $$f; \
npx --no -- markdown-toc --no-first-h1 -i $$f || exit 1; \
else \
echo markdown-toc: no TOC markers, skipping $$f; \
fi; \
done

.PHONY: markdownlint
markdownlint:
@if ! npm ls markdownlint; then npm install; fi
@for f in $(ALL_DOCS); do echo $$f; npx markdownlint -c .markdownlint.yaml $$f || exit 1; done
@for f in $(ALL_DOCS); do \
echo $$f; \
npx --no -p markdownlint-cli markdownlint -c .markdownlint.yaml $$f \
|| exit 1; \
done

.PHONY: install-yamllint
install-yamllint:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"devDependencies": {
"markdown-link-check": "^3.9.3",
"markdown-toc": "^1.2.0",
"markdownlint-cli": "0.31.0"
"markdownlint-cli": "^0.31.0"
}
}

0 comments on commit 7f194d1

Please sign in to comment.