diff --git a/spcd/bootstrap.sh b/spcd/bootstrap.sh index 666b589..52e0ff3 100644 --- a/spcd/bootstrap.sh +++ b/spcd/bootstrap.sh @@ -40,19 +40,20 @@ _spcd_banner_add() { } _spcd_banner_add_index() { - unset spcd_bai__label - unset spcd_bai__level + local label + local level + local value while true; do - spcd_bai__level=$((spcd_bai__level + 1)) - eval "spcd_bai__value=\"\${__SPCD_STEP_${spcd_bai__level}_INDEX}\"" - [ -n "${spcd_bai__value}" ] || break - if [ -n "${spcd_bai__label}" ]; then - spcd_bai__label="${spcd_bai__label}.${spcd_bai__value}" + level=$((level + 1)) + eval "value=\"\${__SPCD_STEP_${level}_INDEX}\"" + [ -n "${value}" ] || break + if [ -n "${label}" ]; then + label="${label}.${value}" else - spcd_bai__label="${spcd_bai__value}" + label="${value}" fi done - _spcd_banner_add "${spcd_bai__label}" + _spcd_banner_add "${label}" } _spcd_banner_append() {