diff --git a/sh/main.sh b/sh/main.sh index 99882a7..7921bce 100644 --- a/sh/main.sh +++ b/sh/main.sh @@ -51,7 +51,7 @@ main_source_directory() { [ -d "${path}" ] || return 1 local cmd count module modules - modules="$(sh_source_find "${path}" "${SH_MAIN_NAME}")" + modules="$(sh_find_sh "${path}" "${SH_MAIN_NAME}")" _sh_ifs_new count=0 _sh_main_log "" \ @@ -74,12 +74,13 @@ main_source_directory() { # public -sh_source_find() { - local root="${1}" - local file="${2}" +sh_find_extension() { + local extension="${1}" + local root="${2}" + local file="${3}" set -- \ "${root}" \ - -name "*.sh" \ + -name "*.${extension}" \ -type "f" [ -n "${file}" ] && set -- "${@}" \ @@ -90,6 +91,10 @@ sh_source_find() { sort } +sh_find_sh() { + sh_find_extension "sh" "${@}" +} + sh_help() { sh_log \ "sh_… = shell functions" \ diff --git a/sh/shellcheck.sh b/sh/shellcheck.sh index d5ccb53..567568c 100644 --- a/sh/shellcheck.sh +++ b/sh/shellcheck.sh @@ -2,7 +2,7 @@ sh_shellcheck() { local root="${1}" local file module modules file="$(mktemp)" - modules="$(sh_source_find "${root}")" + modules="$(sh_find_sh "${root}")" _sh_ifs_new for module in ${modules}; do echo ". \"${root}/${module}\"" >>"${file}"