Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/signal-exit/index.js')
-rw-r--r--node_modules/signal-exit/index.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/node_modules/signal-exit/index.js b/node_modules/signal-exit/index.js
index 337f691ed..6b6c43aca 100644
--- a/node_modules/signal-exit/index.js
+++ b/node_modules/signal-exit/index.js
@@ -3,6 +3,7 @@
// ignored, since we can never get coverage for them.
var assert = require('assert')
var signals = require('./signals.js')
+var isWin = /^win/i.test(process.platform)
var EE = require('events')
/* istanbul ignore if */
@@ -92,6 +93,11 @@ signals.forEach(function (sig) {
/* istanbul ignore next */
emit('afterexit', null, sig)
/* istanbul ignore next */
+ if (isWin && sig === 'SIGHUP') {
+ // "SIGHUP" throws an `ENOSYS` error on Windows,
+ // so use a supported signal instead
+ sig = 'SIGINT'
+ }
process.kill(process.pid, sig)
}
}