mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-04-22 04:18:33 -05:00
fix(audit): handle errors
This commit is contained in:
@@ -20,6 +20,14 @@ exports.auditProject = async function (cwd) {
|
||||
reject: false
|
||||
})
|
||||
|
||||
if (child.stderr) {
|
||||
const errLines = child.stderr.split('\n').map(l => l.trim()).filter(l => l)
|
||||
const error = errLines.find(l => l.startsWith('Error:'))
|
||||
if (error) {
|
||||
throw new Error(error.substr('Error:'.length).trim())
|
||||
}
|
||||
}
|
||||
|
||||
const data = child.stdout
|
||||
|
||||
let auditAdvisories = []
|
||||
|
||||
Reference in New Issue
Block a user