When using scope analyze logs to detect known errors against command failures in a terminal, some commands will print errors to STDERR, which are missed when using a simple pipe (i.e. failing-command | scope analyze logs).
Solution
Implement a new command that can run commands directly, thereby having access to both output streams for error detection.
❯ scope analyze command --help
Runs a command and detects errors in the output
Usage: scope analyze command [OPTIONS] -- <COMMAND>...
Arguments:
<COMMAND>...
The command to run
...
Example
❯ scope -C scope/tests/test-cases/known-errors analyze command -- bin/error-stderr.sh
analyzing: foo
analyzing: bar
analyzing: error
WARN Known error 'error-exists' found on line 2
INFO ==> fix the error and try again
INFO All known errors detected, ignoring rest of output.
Problem
When using
scope analyze logs
to detect known errors against command failures in a terminal, some commands will print errors to STDERR, which are missed when using a simple pipe (i.e.failing-command | scope analyze logs
).Solution
Implement a new command that can run commands directly, thereby having access to both output streams for error detection.
Example