This commit is contained in:
Marc Beninca 2024-11-25 17:17:05 +01:00
parent ec8d1c113c
commit 25e7cc4f6c
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -21,17 +21,21 @@ _sh_ifs_pop() {
}
sh_source_check() {
local file=".shellcheck.sh"
local module modules
modules="$(sh_source_find "." "${file}")"
rm --force "${file}"
local root="${1}"
local file module modules
file="$(mktemp)"
modules="$(sh_source_find "${root}")"
_sh_ifs_new
for module in ${modules}; do
echo ". \"${module}\"" >>"${file}"
echo ". \"${root}/${module}\"" >>"${file}"
done
_sh_ifs_pop
shellcheck \
--check-sourced \
--enable "all" \
--exclude "3043" \
--external-sources \
--shell "dash" \
"${file}"
rm "${file}"
}
@ -76,7 +80,7 @@ main_source_directory() {
_sh_main_log "Not a directory: ${path}"
return 1
fi
local cmd count ifs module modules
local cmd count module modules
modules="$(sh_source_find "${path}" "${SH_MAIN_NAME}")"
_sh_ifs_new
count=0
@ -111,6 +115,7 @@ main_source_file() {
_sh_main() {
main_source_file "${ENV}"
main_source_directory "${SH_USER}"
sh_source_check "$(dirname "${ENV}")"
_sh_main_log "" \
"sh_… = shell functions" \
"a__… = aliases" \