ifs/new,pop

This commit is contained in:
Marc Beninca 2024-11-25 16:38:48 +01:00
parent 678cf741c9
commit ec8d1c113c
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -9,18 +9,27 @@ SH_MAIN="${SH_ROOT}/${SH_MAIN_NAME}"
[ -n "${ENV}" ] || export ENV="${SH_MAIN}"
sh_source_check() {
local file=".shellcheck.sh"
local ifs module modules
modules="$(sh_source_find "." "${file}")"
rm --force "${file}"
ifs="${IFS}"
_sh_ifs_new() {
SH_IFS="${IFS}"
IFS="
"
}
_sh_ifs_pop() {
IFS="${SH_IFS}"
unset SH_IFS
}
sh_source_check() {
local file=".shellcheck.sh"
local module modules
modules="$(sh_source_find "." "${file}")"
rm --force "${file}"
_sh_ifs_new
for module in ${modules}; do
echo ". \"${module}\"" >>"${file}"
done
IFS="${ifs}"
_sh_ifs_pop
shellcheck \
--check-sourced \
"${file}"
@ -69,9 +78,7 @@ main_source_directory() {
fi
local cmd count ifs module modules
modules="$(sh_source_find "${path}" "${SH_MAIN_NAME}")"
ifs="${IFS}"
IFS="
"
_sh_ifs_new
count=0
_sh_main_log "" \
". ${path}"
@ -88,7 +95,7 @@ main_source_directory() {
CMD="${CMD}${cmd}"
fi
done
IFS="${ifs}"
_sh_ifs_pop
}
main_source_file() {