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

This commit is contained in:
Marc Beninca 2025-07-10 02:59:25 +02:00
parent 7d607f1c61
commit bcf879ddc3
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F
2 changed files with 4 additions and 12 deletions

View file

@ -18,8 +18,6 @@ rwx_code_modules_main=""
# user modules names
rwx_code_modules_user=""
# cache of all sourced code modules
_rwx_code=""
# cache for the parsing awk script
_rwx_code_awk="$(cat "${rwx_main_root}/core/code.awk")"
# cache for code aliases
@ -114,12 +112,6 @@ export ENV=\"${rwx_main_path}\"
# │ code │ parts │
# ╰──────┴───────╯
# show the cached code
#= rc
rwx_code() {
echo "${_rwx_code}"
}
# show the cached awk script
rwx_code_awk() {
echo "${_rwx_code_awk}"
@ -135,7 +127,7 @@ rwx_code_aliases() {
rwx_code_command_function() {
local name="${1}"
[ -n "${name}" ] || return
rwx_code |
rwx_code_cache |
awk \
-v action="command function" \
-v target="${name}" \
@ -220,7 +212,7 @@ rwx_code_check() {
rwx_code_doc() {
local name="${1}"
[ -n "${name}" ] || return
rwx_code |
rwx_code_cache |
awk \
-v action="doc" \
-v target="${name}" \
@ -259,7 +251,7 @@ EOF
rwx_code_parse() {
local action="${1}"
rwx_code |
rwx_code_cache |
awk \
-v action="${action}" \
"${_rwx_code_awk}"