ifs/new,pop
This commit is contained in:
parent
678cf741c9
commit
ec8d1c113c
1 changed files with 18 additions and 11 deletions
29
sh/main.sh
29
sh/main.sh
|
@ -9,18 +9,27 @@ SH_MAIN="${SH_ROOT}/${SH_MAIN_NAME}"
|
||||||
|
|
||||||
[ -n "${ENV}" ] || export ENV="${SH_MAIN}"
|
[ -n "${ENV}" ] || export ENV="${SH_MAIN}"
|
||||||
|
|
||||||
sh_source_check() {
|
_sh_ifs_new() {
|
||||||
local file=".shellcheck.sh"
|
SH_IFS="${IFS}"
|
||||||
local ifs module modules
|
|
||||||
modules="$(sh_source_find "." "${file}")"
|
|
||||||
rm --force "${file}"
|
|
||||||
ifs="${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
|
for module in ${modules}; do
|
||||||
echo ". \"${module}\"" >>"${file}"
|
echo ". \"${module}\"" >>"${file}"
|
||||||
done
|
done
|
||||||
IFS="${ifs}"
|
_sh_ifs_pop
|
||||||
shellcheck \
|
shellcheck \
|
||||||
--check-sourced \
|
--check-sourced \
|
||||||
"${file}"
|
"${file}"
|
||||||
|
@ -69,9 +78,7 @@ main_source_directory() {
|
||||||
fi
|
fi
|
||||||
local cmd count ifs module modules
|
local cmd count ifs module modules
|
||||||
modules="$(sh_source_find "${path}" "${SH_MAIN_NAME}")"
|
modules="$(sh_source_find "${path}" "${SH_MAIN_NAME}")"
|
||||||
ifs="${IFS}"
|
_sh_ifs_new
|
||||||
IFS="
|
|
||||||
"
|
|
||||||
count=0
|
count=0
|
||||||
_sh_main_log "" \
|
_sh_main_log "" \
|
||||||
". ${path}"
|
". ${path}"
|
||||||
|
@ -88,7 +95,7 @@ main_source_directory() {
|
||||||
CMD="${CMD}${cmd}"
|
CMD="${CMD}${cmd}"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
IFS="${ifs}"
|
_sh_ifs_pop
|
||||||
}
|
}
|
||||||
|
|
||||||
main_source_file() {
|
main_source_file() {
|
||||||
|
|
Loading…
Reference in a new issue