Skip to content

Commit

Permalink
minor cli fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ascandone committed Jul 25, 2024
1 parent c40ca8e commit 062b633
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions cmd/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,22 @@ var checkCmd = &cobra.Command{
fmt.Printf("%s:%d:%d - %s\n%s\n", path, d.Range.Start.Line, d.Range.Start.Character, errType, d.Kind.Message())
}

fmt.Printf("\n\n")
if len(res.Diagnostics) != 0 {
fmt.Printf("\n\n")
}

errorsCount := res.GetErrorsCount()
if errorsCount != 0 {
fmt.Printf("\033[31mFound %d errors\033[0m\n", errorsCount)

var pluralizedError string
if errorsCount == 1 {
pluralizedError = "error"
} else {
pluralizedError = "errors"

}

fmt.Printf("\033[31mFound %d %s\033[0m\n", errorsCount, pluralizedError)
os.Exit(1)
}

Expand Down

0 comments on commit 062b633

Please sign in to comment.