Skip to content

Commit

Permalink
Refactor: change process.exit comments.
Browse files Browse the repository at this point in the history
Based on
ColemanGariety/gulp-nodemon@8ee28a46a9f335d9ba
bf0131fde29b646cc621c3
Notes:
    - ColemanGariety/gulp-nodemon#77 work on
Mac but not Windows.
    - Not listening to SIGTERM, like
https://github.com/webpack/webpack-dev-server/blob/93cb3dc600e6c547cec75
80ace4bf4a56cf2fe98/bin/webpack-dev-server.js
    - Also consider https://github.com/sindresorhus/exit-hook and it’s
active fork.
  • Loading branch information
Izhaki committed Dec 12, 2017
1 parent 0d809f0 commit cbf4f4e
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,11 @@ module.exports = class {

this.isNodemonRunning = true

// Ensure Ctrl-c stop nodemon.
// Based on https://github.com/JacksonGariety/gulp-nodemon/commit/8ee28a46a9f335d9babf0131fde29b646cc621c3
// Notes:
// - https://github.com/JacksonGariety/gulp-nodemon/issues/77 work on Mac but not Windows.
// - Not listening to SIGTERM, like https://github.com/webpack/webpack-dev-server/blob/93cb3dc600e6c547cec7580ace4bf4a56cf2fe98/bin/webpack-dev-server.js
// - Also consider https://github.com/sindresorhus/exit-hook
// Ensure we exit nodemon when webpack exists.
process.once( 'exit', () => {
monitor.emit( 'exit' )
})
// Ensure Ctrl-C triggers exit.
process.once( 'SIGINT', () => {
process.exit( 0 )
})
Expand Down

0 comments on commit cbf4f4e

Please sign in to comment.