2024-11-29 22:57:21 +01:00
|
|
|
rwx_shellcheck() {
|
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-29 23:59:06 +01:00
|
|
|
modules="$(rwx_find_shell "${root}")"
|
2024-11-29 19:43:06 +01:00
|
|
|
rwx_ifs_set
|
2024-11-25 18:39:25 +01:00
|
|
|
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
|
2024-11-29 19:43:06 +01:00
|
|
|
rwx_ifs_unset
|
2024-12-02 00:46:30 +01:00
|
|
|
rwx_shellcheck_file "${file}"
|
|
|
|
rwx_remove "${file}"
|
|
|
|
}
|
|
|
|
|
|
|
|
rwx_shellcheck_file() {
|
|
|
|
local file="${1}"
|
2024-11-25 18:39:25 +01:00
|
|
|
shellcheck \
|
|
|
|
--check-sourced \
|
|
|
|
--enable "all" \
|
|
|
|
--exclude "3043" \
|
|
|
|
--external-sources \
|
|
|
|
--shell "dash" \
|
|
|
|
"${file}"
|
|
|
|
}
|
2024-12-01 16:41:48 +01:00
|
|
|
|
|
|
|
rwx_shellcheck_write() {
|
|
|
|
rwx_file_write ".shellcheckrc" "\
|
|
|
|
disable=3043
|
|
|
|
enable=all
|
|
|
|
external-sources=true
|
|
|
|
shell=sh
|
|
|
|
"
|
|
|
|
}
|