Skip to content

Commit

Permalink
Debugging version tool pt. 4
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalyisaev2 committed May 21, 2024
1 parent 0d83e27 commit 4803015
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tools/version/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,16 @@ func run(logger *zap.Logger) error {

logger.Info("Version init file generated successfully!")

file.Sync()
out, _ := os.ReadFile(filepath)
// Sometimes script produces invalid output
if err = file.Sync(); err != nil {
return fmt.Errorf("file sync: %w", err)
}

out, err := os.ReadFile(filepath)
if err != nil {
return fmt.Errorf("file sync: %w", err)
}

fmt.Println(string(out))

return nil
Expand Down

0 comments on commit 4803015

Please sign in to comment.