`[command]…` output is prepended to exec `outStream`
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5.9k
- Forks
- 1.8k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
I want to redirect a commands output to a file, but I still want the command that I execute to be logged.
Currently the [command]… log is streamed into the outStream, and not to stdout as I would expect.
To Reproduce
Steps to reproduce the behavior:
await exec.exec("echo", ["foobar"], { outStream: fs.createWriteStream("foobar.txt") });
Expected behavior
I want the foobar.txt file to only have foobar in it.
Instead, it will have the [command]echo foobar command output prepended.
Additional context
Not quite sure if this is intentional?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at packages/exec/src/toolrunner.ts around lines 424-428 and trace how command logging is written when outStream is supplied. Reproduce the issue with the echo example and verify that the output file contains only foobar while the command log remains on stdout.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100