Skip to content

Commit facc8cb

Browse files
bdentinoremy
authored andcommitted
fix: exit with code 1 on crash if --exitcrash (#946)
I'm using nodemon in a docker container with a restart policy configured to restart the container in case it crashes. If the app crashes, nodemon exits with code 0 and docker assumes it was a graceful exit, so it does not restart my container. I don't see the harm in changing the exit code here to reflect an unexpected termination, given that this path is only exercised in the event of a crash.
1 parent 481dc8f commit facc8cb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/monitor/run.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ function run(options) {
169169
if (options.exitcrash) {
170170
utils.log.fail('app crashed');
171171
if (!config.required) {
172-
process.exit(0);
172+
process.exit(1);
173173
}
174174
} else {
175175
utils.log.fail('app crashed - waiting for file changes before' +

0 commit comments

Comments
 (0)