diff --git a/sh/main.sh b/sh/main.sh index e85f519..ac92b40 100644 --- a/sh/main.sh +++ b/sh/main.sh @@ -16,20 +16,6 @@ RWX_SHELL="$(cat "/proc/${$}/comm")" RWX_MAIN_PATH="${RWX_ROOT_SYSTEM}/${RWX_MAIN_NAME}" -# ╭─────────╮ -# │ private │ -# ╰─────────╯ - -_rwx_main_log() { - if rwx_shell_interactive; then - [ ${#} -gt 0 ] || set -- "" - local line - for line in "${@}"; do - echo "${line}" - done - fi -} - # ╭────────╮ # │ public │ # ╰────────╯ @@ -53,6 +39,20 @@ rwx_shell_interactive() { # │ core │ # ╰──────╯ +# ╭──────┬─────╮ +# │ core │ log │ +# ╰──────┴─────╯ + +__rwx_log() { + if rwx_shell_interactive; then + [ ${#} -gt 0 ] || set -- "" + local line + for line in "${@}"; do + echo "${line}" + done + fi +} + # ╭──────┬──────╮ # │ core │ find │ # ╰──────┴──────╯ @@ -107,11 +107,11 @@ rwx_source() { modules="$(rwx_find_shell "${path}" "${RWX_MAIN_NAME}")" rwx_ifs_set count=0 - _rwx_main_log "" \ + __rwx_log "" \ ". ${path}" for module in ${modules}; do count=$((count + 1)) - _rwx_main_log "$(printf "%02d" "${count}") ${module%.sh}" + __rwx_log "$(printf "%02d" "${count}") ${module%.sh}" module="${path}/${module}" # shellcheck disable=SC1090 . "${module}" @@ -133,7 +133,7 @@ rwx_source() { rwx_main() { # system root if ! rwx_source "${RWX_ROOT_SYSTEM}"; then - _rwx_main_log "Not a directory: ${RWX_ROOT_SYSTEM}" + __rwx_log "Not a directory: ${RWX_ROOT_SYSTEM}" return 1 fi # user root