You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
If a postprocessor returns a non-zero (error) exit code, it is not detected, and the empty standard output is returned instead.
To Reproduce
To reproduce this, create an Amber script with an unterminated if statement inside $...$ delimiters:
hwalters@Ghostwheel ~/git/amber-lang (master)
$ cat failing.ab
trust $ if $
We can confirm that shfmt rejects this invalid Bash as follows:
hwalters@Ghostwheel ~/git/amber-lang (master)
$ shfmt <<EOF
> if
> EOF
<standard input>:1:1: "if <cond>" must be followed by "then"
However, when the Amber script is compiled to Bash, the postprocessor ignores the shfmt error:
hwalters@Ghostwheel ~/git/amber-lang (master)
$ amber failing.ab -
#!/usr/bin/env bash
# Written in [Amber](https://amber-lang.com/)
# version: 0.3.5-alpha
# date: 2024-11-09 22:14:43
Expected behavior
Amber should show the contents of the standard error stream returned by the postprocessor:
hwalters@Ghostwheel ~/git/amber-lang (master)
$ amber failing.ab -
ERROR Postprocessor 'shfmt' failed
<standard input>:1:1: "if <cond>" must be followed by "then"
Additional context
This is happening because the ExitStatus (returned by the Child subprocess in the postprocessor code) is not checked for success. It will also be necessary to propagate the error result back up the call chain.
The text was updated successfully, but these errors were encountered:
Describe the bug
If a postprocessor returns a non-zero (error) exit code, it is not detected, and the empty standard output is returned instead.
To Reproduce
To reproduce this, create an Amber script with an unterminated
if
statement inside$...$
delimiters:We can confirm that
shfmt
rejects this invalid Bash as follows:However, when the Amber script is compiled to Bash, the postprocessor ignores the
shfmt
error:Expected behavior
Amber should show the contents of the standard error stream returned by the postprocessor:
Additional context
This is happening because the
ExitStatus
(returned by theChild
subprocess in the postprocessor code) is not checked for success. It will also be necessary to propagate the error result back up the call chain.The text was updated successfully, but these errors were encountered: