追加跟踪细粒度
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
const {exec} = require("child_process");
|
||||
|
||||
class Process {
|
||||
constructor(cmd) {
|
||||
constructor(cmd, cb) {
|
||||
this.cmd = cmd
|
||||
this.pid = exec(cmd, {windowsHide: true, encoding: "utf8"});
|
||||
this.callback = cb
|
||||
}
|
||||
|
||||
static new(cmd) {
|
||||
@@ -28,6 +29,7 @@ class Process {
|
||||
})
|
||||
this.pid.stdout.on('data', data => {
|
||||
console.log(data)
|
||||
this.callback?.()
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user