loopback
This commit is contained in:
parent
ec8d1c113c
commit
25e7cc4f6c
1 changed files with 11 additions and 6 deletions
17
sh/main.sh
17
sh/main.sh
|
@ -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" \
|
||||
|
|
Loading…
Reference in a new issue