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: Treats natural node.js process termination as exit code 0 #24

Merged
merged 1 commit into from
Oct 22, 2022

Conversation

jakobo
Copy link
Sponsor Contributor

@jakobo jakobo commented Oct 17, 2022

Issue

node.js natural process termination triggered an exit code of 128, caused by the asynchronous beforeExit event.

Fix

Changes the asynchronous beforeExit to trigger with an exit code 0, mirroring the behavior used the PM2 event

Summary of Changes - patch level change

  • Moved fixtures to a /fixtures directory (when you create the third fixture, you'll probably need the 4th down the line and this makes it clear where they go)
  • Added empty fixture that replicates the bug reported in 23
  • Resolves issue in index.js

Fixes #23

@sindresorhus sindresorhus merged commit 69881e7 into sindresorhus:main Oct 22, 2022
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.

v3.1.0: exit-hook causes scripts to exit with error code 128 instead of 0
2 participants