@@ -307,81 +307,6 @@ tasks:
307307 cmds :
308308 - poetry install --no-root
309309
310- # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-shell-task/Taskfile.yml
311- shell:check :
312- desc : Check for problems with shell scripts
313- cmds :
314- - |
315- if ! which shellcheck &>/dev/null; then
316- echo "shellcheck not installed or not in PATH. Please install: https://github.com/koalaman/shellcheck#installing"
317- exit 1
318- fi
319- - |
320- # There is something odd about shellcheck that causes the task to always exit on the first fail, despite any
321- # measures that would prevent this with any other command. So it's necessary to call shellcheck only once with
322- # the list of script paths as an argument. This could lead to exceeding the maximum command length on Windows if
323- # the repository contained a large number of scripts, but it's unlikely to happen in reality.
324- shellcheck \
325- --format={{default "tty" .SHELLCHECK_FORMAT}} \
326- $(
327- # The odd method for escaping . in the regex is required for windows compatibility because mvdan.cc/sh gives
328- # \ characters special treatment on Windows in an attempt to support them as path separators.
329- find . \
330- -type d -name '.git' -prune -or \
331- -type d -name '.licenses' -prune -or \
332- -type d -name '__pycache__' -prune -or \
333- -type d -name 'node_modules' -prune -or \
334- \( \
335- -regextype posix-extended \
336- -regex '.*[.](bash|sh)' -and \
337- -type f \
338- \) \
339- -print
340- )
341-
342- # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-shell-task/Taskfile.yml
343- shell:check-mode :
344- desc : Check for non-executable shell scripts
345- cmds :
346- - |
347- EXIT_STATUS=0
348- while read -r nonExecutableScriptPath; do
349- # The while loop always runs once, even if no file was found
350- if [[ "$nonExecutableScriptPath" == "" ]]; then
351- continue
352- fi
353-
354- echo "::error file=${nonExecutableScriptPath}::non-executable script file: $nonExecutableScriptPath";
355- EXIT_STATUS=1
356- done <<<"$(
357- # The odd approach to escaping `.` in the regex is required for windows compatibility because mvdan.cc/sh
358- # gives `\` characters special treatment on Windows in an attempt to support them as path separators.
359- find . \
360- -type d -name '.git' -prune -or \
361- -type d -name '.licenses' -prune -or \
362- -type d -name '__pycache__' -prune -or \
363- -type d -name 'node_modules' -prune -or \
364- \( \
365- -regextype posix-extended \
366- -regex '.*[.](bash|sh)' -and \
367- -type f -and \
368- -not -executable \
369- -print \
370- \)
371- )"
372- exit $EXIT_STATUS
373-
374- # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-shell-task/Taskfile.yml
375- shell:format :
376- desc : Format shell script files
377- cmds :
378- - |
379- if ! which shfmt &>/dev/null; then
380- echo "shfmt not installed or not in PATH. Please install: https://github.com/mvdan/sh#shfmt"
381- exit 1
382- fi
383- - shfmt -w .
384-
385310 # Make a temporary file named according to the passed TEMPLATE variable and print the path passed to stdout
386311 # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/windows-task/Taskfile.yml
387312 utility:mktemp-file :
0 commit comments