提交 7b362015 编写于 作者: Huan (李卓桓)'s avatar Huan (李卓桓)

fix(compitable): do not use promisify because its node v8 only

上级 25f1998c
......@@ -17,7 +17,7 @@
*
*/
import { EventEmitter } from 'events'
import { promisify } from 'util'
// v8.x only import { promisify } from 'util'
const psTree = require('ps-tree')
const retryPromise = require('retry-promise').default // https://github.com/olalonde/retry-promise
......@@ -321,7 +321,15 @@ export class Browser extends EventEmitter {
const head = this.setting.head
try {
const children = await promisify(psTree)(process.pid)
const children = await new Promise((resolve, reject) => {
psTree(process.pid, (err, c) => {
if (err) {
return reject(err)
} else {
return resolve(c)
}
})
})
let regexText: string
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册