main → code
All checks were successful
/ job (push) Successful in 2m56s

This commit is contained in:
Marc Beninca 2025-07-09 07:26:17 +02:00
parent 09bf59c3ba
commit 0e9108999d
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F
2 changed files with 42 additions and 57 deletions

View file

@ -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 <<EOF
${modules_user}
EOF
# cache main modules
while IFS= read -r module; do
# cache main module
_rwx_code="${_rwx_code}#. ${module}
$(cat "${RWX_ROOT_SYSTEM}/${module}.${RWX_MAIN_EXTENSION}")
"
done <<EOF
${modules_main}
EOF
# cache modules
while IFS= read -r module; do
# cache module
_rwx_code="${_rwx_code}#. ${module}
$(cat "${RWX_SELF_USER}/${module}.${RWX_MAIN_EXTENSION}")
"
done <<EOF
${modules_user}
EOF
# load code cache
rwx_code_load
# set command