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

Make stdout and stderr properties undefined instead of null #246

Merged
merged 8 commits into from
May 15, 2019

Conversation

ehmicky
Copy link
Collaborator

@ehmicky ehmicky commented May 14, 2019

The stdout and stderr properties can be undefined with execa(), e.g. when the option stdout: 'ignore' was used.

However with execa.sync(), it is null instead. This change increases consistency by setting those to undefined instead.

@ehmicky ehmicky force-pushed the feature/consistent-stdio branch from 40eb081 to ace8ef2 Compare May 14, 2019 18:11
index.js Show resolved Hide resolved
@ehmicky
Copy link
Collaborator Author

ehmicky commented May 14, 2019

Fixed.

@sindresorhus
Copy link
Owner

Tests are failing on Windows.

@ehmicky
Copy link
Collaborator Author

ehmicky commented May 14, 2019

The Windows tests are fixed on CI now.

The issue is that exec.sync() should be an empty string when the child process emits an error event (as opposed to throwing an exception right away). The only way I manage to trigger that event is by firing a command that does not exist. I even looked up the code in core Node.js and libuv to get ideas on how to trigger this, but I get no ideas. And firing a command that does not exist produces some output on Windows, but not on Unix. But I fixed the test accordingly.

@sindresorhus sindresorhus merged commit c8a53da into master May 15, 2019
@sindresorhus sindresorhus deleted the feature/consistent-stdio branch May 15, 2019 04:59
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 this pull request may close these issues.

2 participants