mirror of
https://github.com/Dadido3/go-typst.git
synced 2025-04-11 12:13:16 +00:00
Switch back to --diagnostic-format human
This commit is contained in:
parent
916336f361
commit
0a600dd2a1
2
cli.go
2
cli.go
@ -55,7 +55,7 @@ func (c CLI) Render(input io.Reader, output io.Writer, options *CLIOptions) erro
|
||||
if options != nil {
|
||||
args = append(args, options.Args()...)
|
||||
}
|
||||
args = append(args, "--diagnostic-format", "short", "-", "-")
|
||||
args = append(args, "--diagnostic-format", "human", "-", "-")
|
||||
|
||||
// Get path of executable.
|
||||
execPath := ExecutablePath
|
||||
|
@ -19,10 +19,6 @@ type Error struct {
|
||||
}
|
||||
|
||||
func (e *Error) Error() string {
|
||||
if e.Message != "" {
|
||||
return e.Message
|
||||
}
|
||||
|
||||
return e.Raw
|
||||
}
|
||||
|
||||
@ -50,8 +46,8 @@ func (e *ErrorWithPath) Unwrap() error {
|
||||
return e.Inner
|
||||
}
|
||||
|
||||
var stderrRegex = regexp.MustCompile(`^error: (?<error>.+)\n`)
|
||||
var stderrWithPathRegex = regexp.MustCompile(`^(?<path>.+):(?<line>\d+):(?<column>\d+): error: (?<error>.+)\n$`)
|
||||
var stderrRegex = regexp.MustCompile(`(?s)^error: (?<error>.+?)\n`)
|
||||
var stderrWithPathRegex = regexp.MustCompile(`(?s)^error: (?<error>.+?)\n\s+┌─ (?<path>.+?):(?<line>\d+):(?<column>\d+)\n`)
|
||||
|
||||
// ParseStderr will parse the given stderr output and return a suitable error object.
|
||||
// Depending on the stderr message, this will return either a typst.Error or a typst.ErrorWithPath error.
|
||||
|
Loading…
Reference in New Issue
Block a user