From 835ad7279c062adf5cc2673c191238fe8d177e8d Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 31 Aug 2024 00:57:21 +0200 Subject: [PATCH] banner/add --- spcd/bootstrap.sh | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/spcd/bootstrap.sh b/spcd/bootstrap.sh index 41aad1f..666b589 100644 --- a/spcd/bootstrap.sh +++ b/spcd/bootstrap.sh @@ -27,18 +27,15 @@ _SPCD_BANNER_VERTICAL="│" _spcd_banner_add() { if [ -n "${1}" ]; then - spcd_ba__text=" ${1} " - spcd_ba__length=${#spcd_ba__text} - spcd_ba__filler="$( - _spcd_fill "${spcd_ba__length}" "${_SPCD_BANNER_HORIZONTAL}" - )" + local text=" ${1} " + local length=${#text} + local filler="$(_spcd_fill "${length}" "${_SPCD_BANNER_HORIZONTAL}")" if [ -n "${__SPCD_BANNER_MIDDLE}" ]; then _spcd_banner_split else _spcd_banner_open fi - _spcd_banner_append \ - "${spcd_ba__filler}" "${spcd_ba__text}" "${spcd_ba__filler}" + _spcd_banner_append "${filler}" "${text}" "${filler}" fi }