@@ -142,13 +142,15 @@ tasks:
142142 desc : Check for broken links
143143 deps :
144144 - task : docs:generate
145+ - task : npm:install-deps
145146 cmds :
146147 - |
147148 if [[ "{{.OS}}" == "Windows_NT" ]]; then
148149 # npx --call uses the native shell, which makes it too difficult to use npx for this application on Windows,
149150 # so the Windows user is required to have markdown-link-check installed and in PATH.
150151 if ! which markdown-link-check &>/dev/null; then
151- echo "markdown-link-check not found or not in PATH. Please install: https://github.com/tcort/markdown-link-check#readme"
152+ echo "markdown-link-check not found or not in PATH."
153+ echo "Please install: https://github.com/tcort/markdown-link-check#readme"
152154 exit 1
153155 fi
154156 # Default behavior of the task on Windows is to exit the task when the first broken link causes a non-zero
@@ -158,7 +160,14 @@ tasks:
158160 # Using -regex instead of -name to avoid Task's behavior of globbing even when quoted on Windows
159161 # The odd method for escaping . in the regex is required for windows compatibility because mvdan.cc/sh gives
160162 # \ characters special treatment on Windows in an attempt to support them as path separators.
161- for file in $(find . -regex ".*[.]md"); do
163+ for file in $(
164+ find . \
165+ -type d -name '.git' -prune -o \
166+ -type d -name '.licenses' -prune -o \
167+ -type d -name '__pycache__' -prune -o \
168+ -type d -name 'node_modules' -prune -o \
169+ -regex ".*[.]md" -print
170+ ); do
162171 markdown-link-check \
163172 --quiet \
164173 --config "./.markdown-link-check.json" \
@@ -169,7 +178,14 @@ tasks:
169178 else
170179 npx --package=markdown-link-check --call='
171180 STATUS=0
172- for file in $(find . -regex ".*[.]md"); do
181+ for file in $(
182+ find . \
183+ -type d -name '.git' -prune -o \
184+ -type d -name '.licenses' -prune -o \
185+ -type d -name '__pycache__' -prune -o \
186+ -type d -name 'node_modules' -prune -o \
187+ -regex ".*[.]md" -print
188+ ); do
173189 markdown-link-check \
174190 --quiet \
175191 --config "./.markdown-link-check.json" \
@@ -183,15 +199,25 @@ tasks:
183199 # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-markdown-task/Taskfile.yml
184200 markdown:fix :
185201 desc : Automatically correct linting violations in Markdown files where possible
202+ deps :
203+ - task : npm:install-deps
186204 cmds :
187205 - npx markdownlint-cli --fix "**/*.md"
188206
189207 # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-markdown-task/Taskfile.yml
190208 markdown:lint :
191209 desc : Check for problems in Markdown files
210+ deps :
211+ - task : npm:install-deps
192212 cmds :
193213 - npx markdownlint-cli "**/*.md"
194214
215+ # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/npm-task/Taskfile.yml
216+ npm:install-deps :
217+ desc : Install dependencies managed by npm
218+ cmds :
219+ - npm install
220+
195221 # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/poetry-task/Taskfile.yml
196222 poetry:install-deps :
197223 desc : Install dependencies managed by Poetry
0 commit comments