Skip to content

Commit 57d72eb

Browse files
committed
🔥 remove ps-tree
1 parent 52eaf86 commit 57d72eb

File tree

2 files changed

+17
-19
lines changed

2 files changed

+17
-19
lines changed

lib/spawn-posix.js

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
//------------------------------------------------------------------------------
1212

1313
const crossSpawn = require("cross-spawn")
14-
const getDescendentProcessInfo = require("ps-tree")
1514

1615
//------------------------------------------------------------------------------
1716
// Helpers
@@ -22,22 +21,22 @@ const getDescendentProcessInfo = require("ps-tree")
2221
* @this ChildProcess
2322
* @returns {void}
2423
*/
25-
function kill() {
26-
getDescendentProcessInfo(this.pid, (err, descendent) => {
27-
if (err) {
28-
return
29-
}
30-
31-
for (const child of descendent) {
32-
try {
33-
process.kill(child.PID)
34-
}
35-
catch (_err) {
36-
// ignore.
37-
}
38-
}
39-
})
40-
}
24+
// function kill() {
25+
// getDescendentProcessInfo(this.pid, (err, descendent) => {
26+
// if (err) {
27+
// return
28+
// }
29+
30+
// for (const child of descendent) {
31+
// try {
32+
// process.kill(child.PID)
33+
// }
34+
// catch (_err) {
35+
// // ignore.
36+
// }
37+
// }
38+
// })
39+
// }
4140

4241
//------------------------------------------------------------------------------
4342
// Public Interface
@@ -58,7 +57,7 @@ function kill() {
5857
*/
5958
module.exports = function spawn(command, args, options) {
6059
const child = crossSpawn(command, args, options)
61-
child.kill = kill
60+
// child.kill = kill
6261

6362
return child
6463
}

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
"cross-spawn": "^6.0.4",
3535
"memorystream": "^0.3.1",
3636
"minimatch": "^3.0.4",
37-
"ps-tree": "^1.1.0",
3837
"read-pkg": "^3.0.0",
3938
"shell-quote": "^1.6.1",
4039
"string.prototype.padend": "^3.0.0"

0 commit comments

Comments
 (0)