Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistency between result.stdout and error.stdout. #674

Closed
ehmicky opened this issue Jan 11, 2024 · 1 comment · Fixed by #686
Closed

Inconsistency between result.stdout and error.stdout. #674

ehmicky opened this issue Jan 11, 2024 · 1 comment · Fixed by #686

Comments

@ehmicky
Copy link
Collaborator

ehmicky commented Jan 11, 2024

We've been trying to keep the shape of an Execa's successful result and an error as close to each other as possible.

At the moment, result.stdout is:

  • undefined when:
    • childProcess.stdout is undefined, e.g. when using stdout: 'ignore'
    • buffer is false
  • an empty string when there is an stdout but it is empty

Distinguishing between those two is useful. However, error.stdout does not do this: instead of undefined, it is an empty string.
We should fix this and make error.stdout behave like result.stdout.

This also applies to result.stderr and result.all.

We should also fix its types as suggested in #673.

@ehmicky
Copy link
Collaborator Author

ehmicky commented Jan 14, 2024

Done by #686.

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 a pull request may close this issue.

1 participant