Skip to content

Conversation

@OmgImAlexis
Copy link
Contributor

This let's the process exit in the same way but still allows the streams to finish before child_process kills it.

Ref: nodejs/node#12921

@OmgImAlexis OmgImAlexis changed the title Fix compatibility with bring run in child_process Fix compatibility with being run in child_process Oct 7, 2019
@sindresorhus
Copy link
Member

The linked issue is old and might not be the reality today. What exactly does this PR fix for you? Make sure you test with the latest Node.js 12 version.

@OmgImAlexis
Copy link
Contributor Author

The issue is process.exit() doesn't wait for stdout to finish.

Ref: https://nodejs.org/api/process.html#process_process_exit_code

Calling process.exit() will force the process to exit as quickly as possible even if there are still asynchronous operations pending that have not yet completed fully, including I/O operations to process.stdout and process.stderr.

@OmgImAlexis
Copy link
Contributor Author

@sindresorhus any chance this can be merged?

@sindresorhus sindresorhus changed the title Fix compatibility with being run in child_process Fix compatibility with being run in a child process Feb 12, 2020
@sindresorhus sindresorhus merged commit 08af7c1 into xojs:master Feb 12, 2020
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