Skip to content

Commit

Permalink
perf: update zx to v8
Browse files Browse the repository at this point in the history
  • Loading branch information
antongolub committed Apr 6, 2024
1 parent 959ba03 commit d274738
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 15 deletions.
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"dependencies": {
"@qiwi/deep-proxy": "^3.0.0",
"@types/ip": "^1.1.3",
"@types/node": "^20.11.30",
"@types/node": "^20.12.5",
"@types/semver": "^7.5.8",
"globby-cp": "^1.3.0",
"ini": "^4.1.2",
Expand All @@ -50,7 +50,7 @@
"semver": "^7.6.0",
"ssri": "^10.0.5",
"tempy": "^3.1.0",
"zx": "7.2.3-dev.0844b88"
"zx": "8.0.0"
},
"devDependencies": {
"c8": "^9.1.0"
Expand Down
16 changes: 12 additions & 4 deletions src/test/js/test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import {
fs,
path,
SSRI,
INI
INI,
ps
} from '../../main/js/index.mjs'

// $.verbose
Expand Down Expand Up @@ -107,16 +108,23 @@ password = dbpassword

// hooks
{
const SIGNAL = 'SIGTERM'
const SIGNAL = 'SIGKILL'
const nothrow = createHook({nothrow: true}, 'nothrow')
const quiet = createHook({ verbose: 0 }, 'quiet')
const quiet = createHook({ verbose: 0, quiet: true }, 'quiet')
const debug = createHook({ verbose: 2 }, 'debug')
const timeout = createHook(
null,
'timeout',
(p, t, signal) => {
if (!t) return p
let timer = setTimeout(() => p.kill(signal), t)
let timer = setTimeout(() => {
console.log('p.pid', p.child.pid);
(async () => {
process.kill(p.child.pid, signal)
console.log('ps', await ps.tree({ pid: p.child.pid, recursive: true }))
})()
p.kill(signal)
}, t)

p.finally(() => clearTimeout(timer))

Expand Down

0 comments on commit d274738

Please sign in to comment.