Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bin/lint-markdown: Use markdown-lint-check executable directly if present #759

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion bin/lint-markdown
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ cd "${script_dir}/.." >/dev/null || exit 1

link_check_config=".github/workflows/markdownlint-config.json"

if command -v markdown-link-check > /dev/null; then
link_check_cmd=markdown-link-check
else
link_check_cmd="npx markdown-link-check"
fi

# Recursively find all markdown files (*.md) in the current directory, excluding node_modules and .venv subfolders.
# Pass them in as args to the lint command using the handy `xargs` command.
find . -name \*.md -not -path "*/node_modules/*" -not -path "*/.venv/*" -print0 | xargs -0 -n1 npx markdown-link-check --config "${link_check_config}"
find . -name \*.md -not -path "*/node_modules/*" -not -path "*/.venv/*" -print0 | xargs -0 -I{} sh -c "${link_check_cmd} --config ${link_check_config} {}"
Loading