Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): bump foreground-child from ^2.0.0 to ^3.0.0 #1546

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 7 additions & 5 deletions bin/nyc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

const configUtil = require('../lib/config-util')
const { cliWrapper, suppressEPIPE } = require('../lib/commands/helpers')
const foreground = require('foreground-child')
const { foregroundChild } = require('foreground-child')
const resolveFrom = require('resolve-from')
const NYC = require('../index.js')

Expand Down Expand Up @@ -86,8 +86,8 @@ async function main () {
// set process.exitCode. Keep track so that both children are run, but
// a non-zero exit codes in either one leads to an overall non-zero exit code.
process.exitCode = 0
foreground(childArgs, async () => {
const mainChildExitCode = process.exitCode
foregroundChild(childArgs, async (code) => {
let exitCode = process.exitCode || code

try {
await nyc.writeProcessIndex()
Expand All @@ -100,18 +100,20 @@ async function main () {
branches: argv.branches,
statements: argv.statements
}, argv['per-file']).catch(suppressEPIPE)
process.exitCode = process.exitCode || mainChildExitCode
exitCode = process.exitCode || exitCode
}

if (!argv.silent) {
await nyc.report().catch(suppressEPIPE)
}
} catch (error) {
/* istanbul ignore next */
process.exitCode = process.exitCode || mainChildExitCode || 1
exitCode = process.exitCode || exitCode || 1
/* istanbul ignore next */
console.error(error.message)
}

return exitCode
})
}

Expand Down