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

Fix unlinking on exit #22

Merged
merged 1 commit into from
Jun 26, 2019
Merged

Conversation

zimme
Copy link
Contributor

@zimme zimme commented Jun 25, 2019

As the same handler for unlinking is used for exit and SIGINT/SIGTERM we need to actually exit the process in case of SIGINT and SIGTERM after unlinking.

Only synchronous function calls are supported in exit handlers so use execa.sync and check exit code of that to see if we should exit with an exit code or not, based on if unlink worked.

@zimme
Copy link
Contributor Author

zimme commented Jun 25, 2019

The current implementation stops ctrl+c from exiting.

As the same handler for unlinking is used for exit and SIGINT/SIGTERM we need to actually exit the process in case of SIGINT and SIGTERM after unlinking.

Only synchronous function calls are supported in exit handlers so use execa.sync and check exit code of that to see if we should exit with an exit code or not, based on if unlink worked.
@vadimdemedes
Copy link
Owner

Thanks!

@vadimdemedes vadimdemedes merged commit cf75d76 into vadimdemedes:master Jun 26, 2019
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