From 195130b14e4181fd8b6c59c622afe684587fa71a Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 25 Aug 2024 15:15:21 +0200 Subject: [PATCH] step/in,out,wipe --- spcd/main.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/spcd/main.sh b/spcd/main.sh index b7c2686..66bd060 100644 --- a/spcd/main.sh +++ b/spcd/main.sh @@ -871,17 +871,19 @@ ${SPCD_PYTHON_ALIAS} / ${spcd_stp__name}" # ╰───────────┴──────╯ spcd_step() { - SPCD_STEP=$((SPCD_STEP + 1)) - SPCD_STEP_TEXT="${*}" - unset SPCD_SUBSTEP SPCD_SUBSTEP_TEXT - spcd_banner + if [ -n "${1}" ]; then + eval "SPCD_STEP_${SPCD_STEP}=\"${1}\"" + spcd_banner + fi } spcd_step_in() { SPCD_STEP=$((SPCD_STEP + 1)) + spcd_step_wipe } spcd_step_out() { + spcd_step_wipe SPCD_STEP=$((SPCD_STEP - 1)) } @@ -1195,6 +1197,10 @@ spcd_banner_unset() { SPCD_STEP=1 +spcd_step_wipe() { + eval "unset SPCD_STEP_${SPCD_STEP}" +} + # ╭──────────╮ # │ internal │ # ╰──────────╯