diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2019-08-16 13:42:54 +0300 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2019-08-16 15:51:16 +0300 |
| commit | c6cc4b1484e6920b76d976e86dfa60c373a21820 (patch) | |
| tree | 33f27d80025a4e77a05379778f59315b71f46744 /gui/scripts | |
| parent | 65553ebf473ae849b79b326861629eb08babe48e (diff) | |
| download | mullvadvpn-c6cc4b1484e6920b76d976e86dfa60c373a21820.tar.xz mullvadvpn-c6cc4b1484e6920b76d976e86dfa60c373a21820.zip | |
Add SIGINT and SIGTERM handlers to properly clean up the watch script
Diffstat (limited to 'gui/scripts')
| -rw-r--r-- | gui/scripts/serve.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gui/scripts/serve.js b/gui/scripts/serve.js index e1642c5b62..01eadbc65f 100644 --- a/gui/scripts/serve.js +++ b/gui/scripts/serve.js @@ -81,3 +81,15 @@ watch.start(...prepareWatchArguments(path.resolve(__dirname, '..'))); watch.on('first_success', () => { startBrowserSync(); }); + +process.on('exit', () => { + watch.kill(); +}); + +process.on('SIGINT', () => { + process.exit(); +}); + +process.on('SIGTERM', () => { + process.exit(); +}); |
