main/extension
All checks were successful
/ job (push) Successful in 2m57s

This commit is contained in:
Marc Beninca 2025-07-09 02:20:50 +02:00
parent 0593181f10
commit 99de96a393
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F
4 changed files with 12 additions and 9 deletions

View file

@ -8,6 +8,9 @@
# │ main │ constants │
# ╰──────┴───────────╯
# extension of shell modules
RWX_MAIN_EXTENSION="sh"
# name of the entrypoint module
RWX_MAIN_NAME="main"
# name of the project itself
@ -36,7 +39,7 @@ rwx_main_find() {
local root="${1}"
find \
"${root}" \
-name "*.sh" \
-name "*.${RWX_MAIN_EXTENSION}" \
-type "f" \
-printf "%P\n" |
sed "s|\\.[^.]*\$||" |
@ -88,7 +91,7 @@ rwx_main_source() {
count=$((count + 1))
_rwx_main_log "$(printf "%02d" "${count}") ${module}"
# shellcheck disable=SC1090
. "${root}/${module}.sh"
. "${root}/${module}.${RWX_MAIN_EXTENSION}"
# cache code
rwx_main_cache "${root}" "${module}"
fi
@ -107,7 +110,7 @@ EOF
rwx_main_cache() {
local root="${1}"
local module="${2}"
local path="${root}/${module}.sh"
local path="${root}/${module}.${RWX_MAIN_EXTENSION}"
local text
text="$(cat "${path}")"
# all source code