Skip to content

fix(interpreter): preserve stdout from if/elif condition commands#905

Merged
chaliy merged 1 commit intomainfrom
fix/if-condition-stdout
Mar 31, 2026
Merged

fix(interpreter): preserve stdout from if/elif condition commands#905
chaliy merged 1 commit intomainfrom
fix/if-condition-stdout

Conversation

@chaliy
Copy link
Copy Markdown
Contributor

@chaliy chaliy commented Mar 31, 2026

Summary

  • execute_if only used condition_result.exit_code, discarding stdout/stderr
  • Patterns like if echo "hello"; then ... or if ! cmd | jq; then ... lost the condition's output
  • Now condition output is prepended to the branch result

Test plan

  • 3 new spec tests: if condition stdout, negated condition, pipeline condition
  • cargo test --all-features passes
  • cargo clippy and cargo fmt clean
  • CI green

execute_if only used condition_result.exit_code, discarding stdout/stderr.
Patterns like `if echo "hello"; then ...` or `if ! cmd | jq; then ...` lost
the condition's output. Now condition output is prepended to the branch result.
@chaliy chaliy force-pushed the fix/if-condition-stdout branch from 52aa6eb to 30ae7e5 Compare March 31, 2026 03:33
@chaliy chaliy merged commit fdc38e7 into main Mar 31, 2026
27 checks passed
@chaliy chaliy deleted the fix/if-condition-stdout branch March 31, 2026 04:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant