diff --git a/sh/core/code.sh b/sh/core/code.sh index a4a5eb0..3d65f5c 100644 --- a/sh/core/code.sh +++ b/sh/core/code.sh @@ -12,6 +12,8 @@ RWX_MAIN_PATH="${RWX_ROOT_SYSTEM}/${RWX_MAIN_NAME}.${RWX_MAIN_EXTENSION}" # user root directory of the project RWX_SELF_USER="${HOME}/${RWX_SELF_NAME}" +# cache of all sourced code modules +_rwx_code="" # cache for the parsing awk script _rwx_code_awk="$(cat "${RWX_ROOT_SYSTEM}/core/code.awk")" # cache for code aliases @@ -223,8 +225,34 @@ rwx_code_parse() { # ╰──────┴──────╯ rwx_code_main() { - # source user root - rwx_main_source "${RWX_SELF_USER}" + local modules_main="${1}" + local module modules_user + # find & source modules + modules_user="$(rwx_main_find "${RWX_SELF_USER}")" + while IFS= read -r module; do + # shellcheck disable=SC1090 + . "${RWX_SELF_USER}/${module}.${RWX_MAIN_EXTENSION}" + done <