Skip to content

Commit

Permalink
fix: update changelog metadata create command to save the correct s…
Browse files Browse the repository at this point in the history
…truct (#194)
  • Loading branch information
andreaangiolillo authored Aug 22, 2024
1 parent 66e5f4e commit bc4623e
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tools/cli/internal/cli/changelog/metadata/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,18 @@ func (o *Opts) Run() error {
o.runDate = time.Now().Format("2006-01-02")
}

metadataBytes, err := json.MarshalIndent(*o.newMetadata(), "", " ")
if err != nil {
return err
}

metadata := *o.newMetadata()
if o.outputPath == "" {
metadataBytes, err := json.MarshalIndent(metadata, "", " ")
if err != nil {
return err
}

fmt.Println(string(metadataBytes))
return nil
}

return openapi.SaveToFile(o.outputPath, openapi.JSON, metadataBytes, o.fs)
return openapi.SaveToFile(o.outputPath, openapi.JSON, metadata, o.fs)
}

func (o *Opts) newMetadata() *changelog.Metadata {
Expand Down

0 comments on commit bc4623e

Please sign in to comment.