Skip to content
Prev Previous commit
Next Next commit
fix: keep previous returncode when using @then
  • Loading branch information
poWer4aiX committed Mar 27, 2025
commit 73434764f43cae14427613b1e9c2f891f8714a9b
2 changes: 2 additions & 0 deletions bash_unit
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,7 @@ gherkin_WHEN() {
}

gherkin_THEN() {
local rc=$?
local COL=""
local NCOL=""
if is_terminal; then
Expand All @@ -556,6 +557,7 @@ gherkin_THEN() {
gherkin_last_msg="${gherkin_last_msg} ${COL}WHEN${NCOL} $gherkin_last_when\n"
gherkin_last_msg="${gherkin_last_msg} ${COL}THEN${NCOL} $gherkin_last_then"
echo ""
return $rc
}

gherkin_AND() { gherkin_THEN "$@"; }
Expand Down