Skip to content

Commit

Permalink
Fix blank routes when nothing to output
Browse files Browse the repository at this point in the history
  • Loading branch information
dorner committed Apr 5, 2024
1 parent e2657f6 commit dc75414
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions protoc-gen-rails/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,13 @@ func main() {
files = append(files, fileResult)
}
}
routeOutput, err := routeFile()
if err != nil {
log.Fatalf("%s", fmt.Errorf("error processing routes: %w", err))
if len(files) > 0 {
routeOutput, err := routeFile()
if err != nil {
log.Fatalf("%s", fmt.Errorf("error processing routes: %w", err))
}
files = append(files, routeOutput)
}
files = append(files, routeOutput)

// process registry
writeResponse(files)
Expand Down

0 comments on commit dc75414

Please sign in to comment.