From d0d0f0c21d84f38cea7ad419fd08650d62889982 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 9 Jul 2025 04:57:58 +0200 Subject: [PATCH 1/5] =?UTF-8?q?=E2=88=92count?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sh/main.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sh/main.sh b/sh/main.sh index 401fccd..ebd8849 100755 --- a/sh/main.sh +++ b/sh/main.sh @@ -81,15 +81,12 @@ rwx_main_source() { local root="${1}" [ -d "${root}" ] || return 1 - local count module modules - count=0 + local module modules _rwx_main_log "" \ ". ${root}" modules="$(rwx_main_find "${root}")" while IFS= read -r module; do if [ "${module}" != "${RWX_MAIN_NAME}" ]; then - count=$((count + 1)) - _rwx_main_log "$(printf "%02d" "${count}") ${module}" # shellcheck disable=SC1090 . "${root}/${module}.${RWX_MAIN_EXTENSION}" # cache code From 032568b82267fe953ece16d3e895fdc193a444c3 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 9 Jul 2025 05:12:32 +0200 Subject: [PATCH 2/5] source/main --- sh/main.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sh/main.sh b/sh/main.sh index ebd8849..ed2949a 100755 --- a/sh/main.sh +++ b/sh/main.sh @@ -79,11 +79,12 @@ _rwx_main_log() { # source code from root path rwx_main_source() { local root="${1}" + local main="${2}" [ -d "${root}" ] || return 1 local module modules - _rwx_main_log "" \ - ". ${root}" + # cache main + [ -n "${main}" ] && rwx_main_cache "${RWX_ROOT_SYSTEM}" "${RWX_MAIN_NAME}" modules="$(rwx_main_find "${root}")" while IFS= read -r module; do if [ "${module}" != "${RWX_MAIN_NAME}" ]; then @@ -124,10 +125,8 @@ ${text} # run initial steps #< core/code rwx_main_main() { - # cache main - rwx_main_cache "${RWX_ROOT_SYSTEM}" "${RWX_MAIN_NAME}" # source system root - if ! rwx_main_source "${RWX_ROOT_SYSTEM}"; then + if ! rwx_main_source "${RWX_ROOT_SYSTEM}" "${RWX_MAIN_NAME}"; then _rwx_main_log "Not a directory: ${RWX_ROOT_SYSTEM}" return 1 fi From 63c48f7de916e6b7ae8c9ae5ac4a7aa0564142ad Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 9 Jul 2025 05:14:21 +0200 Subject: [PATCH 3/5] source/root,main --- sh/main.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sh/main.sh b/sh/main.sh index ed2949a..682605e 100755 --- a/sh/main.sh +++ b/sh/main.sh @@ -84,7 +84,7 @@ rwx_main_source() { return 1 local module modules # cache main - [ -n "${main}" ] && rwx_main_cache "${RWX_ROOT_SYSTEM}" "${RWX_MAIN_NAME}" + [ -n "${main}" ] && rwx_main_cache "${root}" "${main}" modules="$(rwx_main_find "${root}")" while IFS= read -r module; do if [ "${module}" != "${RWX_MAIN_NAME}" ]; then From 09bf59c3ba1e377a724ff03e69b9af1ab07e6b9d Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 9 Jul 2025 05:15:32 +0200 Subject: [PATCH 4/5] module/main --- sh/main.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sh/main.sh b/sh/main.sh index 682605e..bb5b3bb 100755 --- a/sh/main.sh +++ b/sh/main.sh @@ -87,7 +87,7 @@ rwx_main_source() { [ -n "${main}" ] && rwx_main_cache "${root}" "${main}" modules="$(rwx_main_find "${root}")" while IFS= read -r module; do - if [ "${module}" != "${RWX_MAIN_NAME}" ]; then + if [ "${module}" != "${main}" ]; then # shellcheck disable=SC1090 . "${root}/${module}.${RWX_MAIN_EXTENSION}" # cache code From 00005aa03d4b4b904529c263e55b4edad923ddb2 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 9 Jul 2025 05:25:01 +0200 Subject: [PATCH 5/5] code/relay --- sh/core/code.sh | 3 +++ sh/main.sh | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/sh/core/code.sh b/sh/core/code.sh index a4a5eb0..39675ca 100644 --- a/sh/core/code.sh +++ b/sh/core/code.sh @@ -223,6 +223,9 @@ rwx_code_parse() { # ╰──────┴──────╯ rwx_code_main() { + local code="${1}" + shift + _rwx_code="${code}" # source user root rwx_main_source "${RWX_SELF_USER}" # load code cache diff --git a/sh/main.sh b/sh/main.sh index bb5b3bb..288b2f8 100755 --- a/sh/main.sh +++ b/sh/main.sh @@ -125,13 +125,15 @@ ${text} # run initial steps #< core/code rwx_main_main() { + local code # source system root if ! rwx_main_source "${RWX_ROOT_SYSTEM}" "${RWX_MAIN_NAME}"; then _rwx_main_log "Not a directory: ${RWX_ROOT_SYSTEM}" return 1 fi + code="${_rwx_code}" # run code main function - rwx_code_main "${@}" + rwx_code_main "${code}" "${@}" } # run main function