mirror of
https://github.com/ilammy/msvc-dev-cmd.git
synced 2026-09-06 21:57:19 +08:00
Print the error message from conf scripts at once (#41)
Printing them line by line will generate a bunch of error messages on the summary page of GitHub Actions workflow. I think it's a bit annoying. Note that this change will also affect the format of the final output error message, but no information will be lost.
This commit is contained in:
@@ -126,19 +126,17 @@ function main() {
|
|||||||
// If vsvars.bat is given an incorrect command line, it will print out
|
// If vsvars.bat is given an incorrect command line, it will print out
|
||||||
// an error and *still* exit successfully. Parse out errors from output
|
// an error and *still* exit successfully. Parse out errors from output
|
||||||
// which don't look like environment variables, and fail if appropriate.
|
// which don't look like environment variables, and fail if appropriate.
|
||||||
var failed = false
|
const error_messages = vcvars_output.filter((line) => {
|
||||||
for (let line of vcvars_output) {
|
|
||||||
if (line.match(/^\[ERROR.*\]/)) {
|
if (line.match(/^\[ERROR.*\]/)) {
|
||||||
failed = true
|
|
||||||
// Don't print this particular line which will be confusing in output.
|
// Don't print this particular line which will be confusing in output.
|
||||||
if (line.match(/Error in script usage. The correct usage is:$/)) {
|
if (!line.match(/Error in script usage. The correct usage is:$/)) {
|
||||||
continue
|
return true
|
||||||
}
|
}
|
||||||
core.error(line)
|
|
||||||
}
|
}
|
||||||
}
|
return false
|
||||||
if (failed) {
|
})
|
||||||
throw new Error('invalid parameters')
|
if (error_messages.length > 0) {
|
||||||
|
throw new Error('invalid parameters' + '\r\n' + error_messages.join('\r\n'))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert old environment lines into a dictionary for easier lookup.
|
// Convert old environment lines into a dictionary for easier lookup.
|
||||||
|
|||||||
Reference in New Issue
Block a user