Skip to content

Commit ce5f0fe

Browse files
chore: follow conventions
1 parent 11c92b1 commit ce5f0fe

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/subcomandante-lite.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
'use strict'
22

33
const runner = require('child_process')
4-
const debug = require('debug')('subchild')
4+
const debug = require('debug')
5+
const log = debug('ipfsd-ctl:sclite')
56

67
const children = []
78

@@ -13,30 +14,29 @@ function removeChild (child) {
1314
}
1415

1516
function killAll () {
16-
debug('killing all children')
17+
log('killing all children')
1718
let child
1819
while ((child = children.shift()) !== undefined) {
19-
debug(child.pid, 'killing')
20+
log(child.pid, 'killing')
2021
child.kill()
2122
}
2223
}
2324

24-
process.once('error', killAll)
2525
process.once('exit', killAll)
2626
process.once('SIGTERM', killAll)
2727
process.once('SIGINT', killAll)
2828

2929
function run (cmd, args, opts) {
3030
const child = runner.execFile(cmd, args, opts)
31-
debug(child.pid, 'new')
31+
log(child.pid, 'new')
3232

3333
children.push(child)
3434
child.once('error', () => {
35-
debug(child.pid, 'error')
35+
log(child.pid, 'error')
3636
removeChild(child)
3737
})
3838
child.once('exit', () => {
39-
debug(child.pid, 'exit')
39+
log(child.pid, 'exit')
4040
removeChild(child)
4141
})
4242
return child

0 commit comments

Comments
 (0)