cache/fill

This commit is contained in:
Marc Beninca 2025-07-03 21:27:44 +02:00
parent 8c55351aae
commit 94689a23bf
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -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 │
# ╰──────┴────────╯