diff --git a/sh/lint/shellcheck.sh b/sh/lint/shellcheck.sh index 0253062..c6aabb6 100644 --- a/sh/lint/shellcheck.sh +++ b/sh/lint/shellcheck.sh @@ -2,7 +2,7 @@ rwx_shellcheck() { local root="${1}" local file module modules path file="$(mktemp)" - modules="$(rwx_find_shell "${root}")" + modules="$(rwx_main_find "${root}")" while IFS= read -r module; do path="${root}/${module}" echo ". \"${path}\"" >>"${file}" diff --git a/sh/main.sh b/sh/main.sh index a8d1321..4910ba8 100755 --- a/sh/main.sh +++ b/sh/main.sh @@ -28,16 +28,15 @@ RWX_ROOT_SYSTEM="/usr/local/lib/${RWX_SELF_NAME}" # │ main │ find │ # ╰──────┴──────╯ -# find directory’s files by extension +# find directory’s shell files #| find #| sort -rwx_find_extension() { - local extension="${1}" - local root="${2}" - local file="${3}" +rwx_main_find() { + local root="${1}" + local file="${2}" set -- \ "${root}" \ - -name "*.${extension}" \ + -name "*.sh" \ -type "f" [ -n "${file}" ] && set -- "${@}" \ @@ -48,11 +47,6 @@ rwx_find_extension() { sort } -# find directory’s sh files -rwx_find_shell() { - rwx_find_extension "sh" "${@}" -} - # ╭──────┬───────╮ # │ main │ shell │ # ╰──────┴───────╯ @@ -93,7 +87,7 @@ rwx_main_source() { count=0 _rwx_main_log "" \ ". ${root}" - modules="$(rwx_find_shell "${root}" "${file}")" + modules="$(rwx_main_find "${root}" "${file}")" while IFS= read -r module; do count=$((count + 1)) _rwx_main_log "$(printf "%02d" "${count}") ${module%.sh}" diff --git a/sh/self.sh b/sh/self.sh index 76424f3..a8a6dbf 100644 --- a/sh/self.sh +++ b/sh/self.sh @@ -14,7 +14,7 @@ rwx_self_subset() { file="${argument}.sh" if [ -d "${root}" ]; then local file - for file in $(rwx_find_shell "${root}"); do + for file in $(rwx_main_find "${root}"); do echo "${argument}/${file}" done elif [ -f "${RWX_ROOT_SYSTEM}/${file}" ]; then