doc/wip
This commit is contained in:
parent
3da235e09e
commit
47882c10fe
2 changed files with 47 additions and 33 deletions
26
sh/main.sh
26
sh/main.sh
|
@ -8,6 +8,7 @@
|
|||
# │ main │ constants │
|
||||
# ╰──────┴───────────╯
|
||||
|
||||
# name of the entrypoint file
|
||||
RWX_MAIN_NAME="main.sh"
|
||||
RWX_SELF_NAME="rwx"
|
||||
|
||||
|
@ -61,37 +62,22 @@ rwx_main() {
|
|||
# │ main │ cache │
|
||||
# ╰──────┴───────╯
|
||||
|
||||
RWX_CODE=""
|
||||
|
||||
# cache source code of a module
|
||||
rwx_cache() {
|
||||
local root="${1}"
|
||||
local module="${2}"
|
||||
local name="${module%.sh}"
|
||||
local path="${root}/${module}"
|
||||
local fill text
|
||||
fill="$(rwx_fill "${#name}" ─)"
|
||||
local text
|
||||
text="$(cat "${path}")"
|
||||
[ -n "${RWX_CODE}" ] && RWX_CODE="${RWX_CODE}
|
||||
"
|
||||
RWX_CODE="${RWX_CODE}\
|
||||
# ╭───┬────┬─${fill}─╮
|
||||
# │ ↙ │ sh │ ${name} │
|
||||
# ╰───┴────┴─${fill}─╯
|
||||
|
||||
#↓ ${name}
|
||||
${text}
|
||||
"
|
||||
}
|
||||
|
||||
# ╭──────┬──────╮
|
||||
# │ main │ fill │
|
||||
# ╰──────┴──────╯
|
||||
|
||||
rwx_fill() {
|
||||
local index="${1}"
|
||||
while [ "${index}" -gt 0 ]; do
|
||||
printf "%s" "${2}"
|
||||
index=$((index - 1))
|
||||
done
|
||||
}
|
||||
|
||||
# ╭──────┬────────╮
|
||||
# │ main │ source │
|
||||
# ╰──────┴────────╯
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue