From 0e9108999d02f682b0342d5735d9f9d49985aa78 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 9 Jul 2025 07:26:17 +0200 Subject: [PATCH] =?UTF-8?q?main=20=E2=86=92=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sh/core/code.sh | 32 +++++++++++++++++++++-- sh/main.sh | 67 +++++++++---------------------------------------- 2 files changed, 42 insertions(+), 57 deletions(-) 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 <