Compare commits
No commits in common. "9d7c77b881120d7185e9cb1cb8c42e344c4f8138" and "2a9169947ec6855b6a9b507635d2d099a3542ec5" have entirely different histories.
9d7c77b881
...
2a9169947e
1 changed files with 0 additions and 32 deletions
32
sh/main.sh
32
sh/main.sh
|
@ -46,8 +46,6 @@ rwx_main() {
|
|||
fi
|
||||
# source user root
|
||||
rwx_source "${RWX_SELF_USER}"
|
||||
# parse code cache
|
||||
rwx_parse
|
||||
# context / command
|
||||
if [ -n "${RWX_COMMAND_NAME}" ]; then
|
||||
"${RWX_SELF_COMMAND}${RWX_COMMAND_NAME}" "${@}"
|
||||
|
@ -197,36 +195,6 @@ rwx_find_shell() {
|
|||
rwx_find_extension "sh" "${@}"
|
||||
}
|
||||
|
||||
# ╭──────┬───────╮
|
||||
# │ main │ parse │
|
||||
# ╰──────┴───────╯
|
||||
|
||||
rwx_parse() {
|
||||
local ws="[[:space:]]*"
|
||||
local start="^${ws}"
|
||||
local constant="[_A-Z][_0-9A-Z]*"
|
||||
local setting="=.*"
|
||||
local func="${ws}(${ws})${ws}{.*"
|
||||
local id="[_a-zA-Z][_a-z0-9A-Z]*"
|
||||
local line
|
||||
rwx_ifs_set
|
||||
RWX_CONSTANTS=""
|
||||
for line in $(echo "${RWX_CODE}" |
|
||||
grep "${start}${constant}${setting}" |
|
||||
sed "s|${start}\\(${constant}\\)${setting}|\\1|"); do
|
||||
RWX_CONSTANTS="${RWX_CONSTANTS}${line}
|
||||
"
|
||||
done
|
||||
RWX_FUNCTIONS=""
|
||||
for line in $(echo "${RWX_CODE}" |
|
||||
grep "${start}${id}${func}" |
|
||||
sed "s|${start}\\(${id}\\)${func}|\\1|"); do
|
||||
RWX_FUNCTIONS="${RWX_FUNCTIONS}${line}
|
||||
"
|
||||
done
|
||||
rwx_ifs_unset
|
||||
}
|
||||
|
||||
# ╭──────┬─────╮
|
||||
# │ main │ run │
|
||||
# ╰──────┴─────╯
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue