diff --git a/sh/main.sh b/sh/main.sh index 3ee4c6f..ea6a4d0 100644 --- a/sh/main.sh +++ b/sh/main.sh @@ -11,14 +11,16 @@ SH_MAIN="${SH_ROOT}/${SH_MAIN_NAME}" sh_source_check() { local file=".shellcheck.sh" - find \ - "." \ - -type "f" \ - -name "*.sh" \ - -not \ - -name "${file}" \ - -printf ". \"%P\"\n" \ - >"${file}" + local ifs module modules + modules="$(sh_source_find "." "${file}")" + rm --force "${file}" + ifs="${IFS}" + IFS=" +" + for module in ${modules}; do + echo ". \"${module}\"" >>"${file}" + done + IFS="${ifs}" shellcheck \ --check-sourced \ "${file}"