rwx/sh/lint/shellcheck.sh

21 lines
397 B
Bash
Raw Normal View History

2024-11-29 17:16:56 +01:00
rwx_shellcheck_check() {
2024-11-25 18:39:25 +01:00
local root="${1}"
2024-11-29 12:17:39 +01:00
local file module modules path
2024-11-25 18:39:25 +01:00
file="$(mktemp)"
2024-11-25 20:46:09 +01:00
modules="$(sh_find_sh "${root}")"
2024-11-25 18:39:25 +01:00
_sh_ifs_new
for module in ${modules}; do
2024-11-29 12:17:39 +01:00
path="${root}/${module}"
echo ". \"${path}\"" >>"${file}"
2024-11-25 18:39:25 +01:00
done
_sh_ifs_pop
shellcheck \
--check-sourced \
--enable "all" \
--exclude "3043" \
--external-sources \
--shell "dash" \
"${file}"
rm "${file}"
}