code/commands
This commit is contained in:
parent
51cb88d0d3
commit
cc1f8f816a
2 changed files with 21 additions and 2 deletions
13
sh/code.sh
13
sh/code.sh
|
@ -12,6 +12,8 @@ _rwx_code_awk="$(cat "${RWX_ROOT_SYSTEM}/code.awk")"
|
|||
_rwx_code_aliases=""
|
||||
# cache for code aliases functions
|
||||
_rwx_code_aliases_functions=""
|
||||
# cache for code commands
|
||||
_rwx_code_commands=""
|
||||
# cache for code constants
|
||||
_rwx_code_constants=""
|
||||
# cache for code functions
|
||||
|
@ -23,7 +25,7 @@ _rwx_code_variables=""
|
|||
# │ code │ install │
|
||||
# ╰──────┴─────────╯
|
||||
|
||||
#= rwx_install
|
||||
#/ rwx_install
|
||||
rwx_code_install() {
|
||||
local target="${1}"
|
||||
local command file name root
|
||||
|
@ -44,7 +46,7 @@ rwx_code_install() {
|
|||
rwx_remove "${file}"
|
||||
rwx_link "${file}" "${name}"
|
||||
done <<EOF
|
||||
${_rwx_code_aliases}
|
||||
${_rwx_code_commands}
|
||||
EOF
|
||||
# sh
|
||||
file="${target}/etc/profile.d/${RWX_SELF_NAME}.sh"
|
||||
|
@ -100,6 +102,11 @@ rwx_code_aliases_functions() {
|
|||
echo "${_rwx_code_aliases_functions}"
|
||||
}
|
||||
|
||||
# show the cached commands
|
||||
rwx_code_commands() {
|
||||
echo "${_rwx_code_commands}"
|
||||
}
|
||||
|
||||
# show the cached constants
|
||||
#= rcc
|
||||
rwx_code_constants() {
|
||||
|
@ -157,6 +164,8 @@ rwx_code_load() {
|
|||
done <<EOF
|
||||
${_rwx_code_aliases_functions}
|
||||
EOF
|
||||
# parse commands
|
||||
_rwx_code_commands="$(rwx_code_parse "commands")"
|
||||
# parse constants
|
||||
_rwx_code_constants="$(rwx_code_parse "constants")"
|
||||
# parse functions
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue