parse/commands,functions
All checks were successful
/ job (push) Successful in 4m55s

This commit is contained in:
Marc Beninca 2025-07-08 15:54:55 +02:00
parent 3b222fda83
commit 967e17e224
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -200,10 +200,8 @@ rwx_code_doc() {
}
rwx_code_load() {
# parse aliases
_rwx_code_aliases="$(rwx_code_parse "aliases")"
# parse aliases functions
local line text
# parse aliases functions
_rwx_code_aliases_functions="$(rwx_code_parse "aliases functions")"
while IFS= read -r line; do
text="$(echo "${line}" | sed "s| |() { |")"
@ -212,6 +210,17 @@ rwx_code_load() {
done <<EOF
${_rwx_code_aliases_functions}
EOF
# parse commands functions
_rwx_code_commands_functions="$(rwx_code_parse "commands functions")"
while IFS= read -r line; do
text="$(echo "${line}" | sed "s| |() { |")"
text="${text} \"\${@}\"; }"
eval "${text}"
done <<EOF
${_rwx_code_commands_functions}
EOF
# parse aliases
_rwx_code_aliases="$(rwx_code_parse "aliases")"
# parse binaries
_rwx_code_binaries="$(rwx_code_parse "binaries")"
# parse commands