cache/fill
This commit is contained in:
parent
8c55351aae
commit
94689a23bf
1 changed files with 20 additions and 5 deletions
25
sh/main.sh
25
sh/main.sh
|
@ -67,16 +67,31 @@ rwx_cache() {
|
|||
local text="$(cat "${path}")"
|
||||
case "${text}" in
|
||||
"#!"*) RWX_CODE="${text}" ;;
|
||||
*) RWX_CODE="${RWX_CODE}
|
||||
*)
|
||||
local fill="$(rwx_fill "${#name}" ─)"
|
||||
RWX_CODE="${RWX_CODE}
|
||||
|
||||
# ╭╮
|
||||
# │ ${name} │
|
||||
# ╰╯
|
||||
# ╭───┬─${fill}─╮
|
||||
# │ ↙ │ ${name} │
|
||||
# ╰───┴─${fill}─╯
|
||||
|
||||
${text}" ;;
|
||||
${text}"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# ╭──────┬──────╮
|
||||
# │ 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