Commit 30ae7e5
committed
fix(interpreter): preserve stdout from if/elif condition commands
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.1 parent 9e7f605 commit 30ae7e5
File tree
2 files changed
+52
-5
lines changed- crates/bashkit
- src/interpreter
- tests/spec_cases/bash
2 files changed
+52
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1432 | 1432 | | |
1433 | 1433 | | |
1434 | 1434 | | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
1435 | 1439 | | |
1436 | 1440 | | |
| 1441 | + | |
| 1442 | + | |
1437 | 1443 | | |
1438 | 1444 | | |
1439 | 1445 | | |
1440 | | - | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
1441 | 1450 | | |
1442 | 1451 | | |
1443 | 1452 | | |
1444 | 1453 | | |
1445 | 1454 | | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
1446 | 1458 | | |
1447 | | - | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
1448 | 1463 | | |
1449 | 1464 | | |
1450 | 1465 | | |
1451 | 1466 | | |
1452 | 1467 | | |
1453 | | - | |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
1454 | 1472 | | |
1455 | 1473 | | |
1456 | | - | |
1457 | | - | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
1458 | 1481 | | |
1459 | 1482 | | |
1460 | 1483 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
0 commit comments