Skip to content

Commit

Permalink
fix: remove latest information from release file (#16)
Browse files Browse the repository at this point in the history
After usage, it turns out that updating all previous release file
are super noisy.
For example updatecli/website#1357

Signed-off-by: Olivier Vernin <[email protected]>
  • Loading branch information
olblak committed Mar 17, 2024
1 parent 8ed0423 commit d02186e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
4 changes: 1 addition & 3 deletions internal/core/changelog/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ type IndexData struct {
}

type ReleaseData struct {
Latest Spec
Changelog Spec
FrontMatters string
}
Expand Down Expand Up @@ -116,7 +115,6 @@ func (c Config) SaveToDisk(changelogs []Spec) error {

for i := range changelogs {
data := ReleaseData{
Latest: changelogs[0],
Changelog: changelogs[i],
}

Expand Down Expand Up @@ -194,7 +192,6 @@ func (c Config) SaveIndexToDisk(changelogs []Spec) error {
}

data := IndexData{
Latest: changelogs[0],
Changelogs: changelogs,
}

Expand Down Expand Up @@ -229,6 +226,7 @@ func (c Config) SaveIndexToDisk(changelogs []Spec) error {
}
data.Changelogs = shortChangelogs
data.Latest = shortChangelogs[0]
data.FrontMatters = ""

if err = toJsonFile(data, filepath.Join(c.Dir, indexFileName)); err != nil {
fmt.Printf("creating index json file %s: %v", filepath.Join(c.Dir, "index.json"), err)
Expand Down
4 changes: 0 additions & 4 deletions internal/core/changelog/format_asciidoc.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ var (
__{{ .Changelog.Author }} released this {{ .Changelog.PublishedAt }} - {{ .Changelog.Tag }}__
{{ end }}
{{ if ne .Changelog.Tag .Latest.Tag }}
IMPORTANT: This changelog is not the latest one, please refer to {{ .Latest.Name }} for the latest changelog.
{{ end }}
=== Description
---
Expand Down

0 comments on commit d02186e

Please sign in to comment.