Skip to content

Commit b46b640

Browse files
author
Benjamin E. Coe
authored
feat(deps): update foreground-child to promise API (#512)
1 parent ef672da commit b46b640

File tree

3 files changed

+31
-22
lines changed

3 files changed

+31
-22
lines changed

bin/c8.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env node
22
'use strict'
33

4-
const foreground = require('foreground-child')
4+
const { foregroundChild } = require('foreground-child')
55
const { outputReport } = require('../lib/commands/report')
66
const { rm, mkdir } = require('fs/promises')
77
const {
@@ -25,14 +25,14 @@ async function run () {
2525

2626
await mkdir(argv.tempDirectory, { recursive: true })
2727
process.env.NODE_V8_COVERAGE = argv.tempDirectory
28-
foreground(hideInstrumenterArgs(argv), async (done) => {
28+
foregroundChild(hideInstrumenterArgs(argv), async () => {
2929
try {
3030
await outputReport(argv)
31+
return process.exitCode
3132
} catch (err) {
3233
console.error(err.stack)
33-
process.exitCode = 1
34+
return 1
3435
}
35-
done()
3636
})
3737
}
3838
}

package-lock.json

Lines changed: 25 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"@bcoe/v8-coverage": "^0.2.3",
3737
"@istanbuljs/schema": "^0.1.3",
3838
"find-up": "^5.0.0",
39-
"foreground-child": "^2.0.0",
39+
"foreground-child": "^3.1.1",
4040
"istanbul-lib-coverage": "^3.2.0",
4141
"istanbul-lib-report": "^3.0.1",
4242
"istanbul-reports": "^3.1.6",
@@ -64,4 +64,4 @@
6464
"lib",
6565
"bin"
6666
]
67-
}
67+
}

0 commit comments

Comments
 (0)