main/comments
All checks were successful
/ job (push) Successful in 2m58s

This commit is contained in:
Marc Beninca 2025-07-09 23:12:57 +02:00
parent 289ee65a98
commit 7a8915682d
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -7,27 +7,27 @@
# │ main │ constants │
# ╰──────┴───────────╯
# parent directory for the project
# project parent directory
RWX_MAIN_PARENT="/usr/local/lib"
# name of the project itself
# project name
RWX_MAIN_NAME="rwx"
# name of the entrypoint module
# project entrypoint module
RWX_MAIN_MODULE="main"
# extension of shell modules
# shell modules extension
RWX_MAIN_EXTENSION="sh"
# ╭──────┬───────────╮
# │ main │ variables │
# ╰──────┴───────────╯
# system root directory of the project
# project main root directory
rwx_main_root="${RWX_MAIN_PARENT}/${RWX_MAIN_NAME}"
# ╭──────┬──────╮
# │ main │ find │
# ╰──────┴──────╯
# find directory’s shell files
# find root directory shell modules
#| find
#| sed
#| sort
@ -46,13 +46,16 @@ rwx_main_find() {
# │ main │ main │
# ╰──────┴──────╯
# run initial steps
# run required initial steps
#< core/code
rwx_main_main() {
local module modules
# find & source modules
local module
local modules
# find main modules
modules="$(rwx_main_find "${rwx_main_root}")"
# source main modules
while IFS= read -r module; do
# except currently running main module
if [ "${module}" != "${RWX_MAIN_MODULE}" ]; then
# shellcheck disable=SC1090
. "${rwx_main_root}/${module}.${RWX_MAIN_EXTENSION}"
@ -60,7 +63,7 @@ rwx_main_main() {
done <<EOF
${modules}
EOF
# run code main function
# run code module main function with found main modules
rwx_code_main "${modules}" "${@}"
}