We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ed0df4e commit 804ad9fCopy full SHA for 804ad9f
npm/src/bin.mjs
@@ -28,7 +28,14 @@ if (!platformPackage) {
28
process.exit(1)
29
}
30
31
-NodeChildProcess.spawn(selectBinaryPath(), process.argv.slice(2), { stdio: 'inherit' })
+const child = NodeChildProcess.spawn(
32
+ selectBinaryPath(),
33
+ process.argv.slice(2),
34
+ { stdio: 'inherit' }
35
+)
36
+
37
+process.on('SIGINT', killChild)
38
+process.on('SIGTERM', killChild)
39
40
/**
41
* Determines which tool wrapper is executing.
@@ -117,3 +124,10 @@ function selectBinaryPath() {
117
124
118
125
return NodePath.join(__dirname, '..', 'dist', binaryName)
119
126
127
128
+/**
129
+ * Kills the child process.
130
+ */
131
+function killChild() {
132
+ child.kill()
133
+}
0 commit comments