From d02186e3e3279b3abfb84ec3870026a5d7615784 Mon Sep 17 00:00:00 2001 From: Olivier Vernin Date: Sun, 17 Mar 2024 08:38:39 +0100 Subject: [PATCH] fix: remove latest information from release file (#16) After usage, it turns out that updating all previous release file are super noisy. For example https://github.com/updatecli/website/pull/1357 Signed-off-by: Olivier Vernin --- internal/core/changelog/config.go | 4 +--- internal/core/changelog/format_asciidoc.go | 4 ---- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/internal/core/changelog/config.go b/internal/core/changelog/config.go index 84779f3..ce59a24 100644 --- a/internal/core/changelog/config.go +++ b/internal/core/changelog/config.go @@ -12,7 +12,6 @@ type IndexData struct { } type ReleaseData struct { - Latest Spec Changelog Spec FrontMatters string } @@ -116,7 +115,6 @@ func (c Config) SaveToDisk(changelogs []Spec) error { for i := range changelogs { data := ReleaseData{ - Latest: changelogs[0], Changelog: changelogs[i], } @@ -194,7 +192,6 @@ func (c Config) SaveIndexToDisk(changelogs []Spec) error { } data := IndexData{ - Latest: changelogs[0], Changelogs: changelogs, } @@ -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) diff --git a/internal/core/changelog/format_asciidoc.go b/internal/core/changelog/format_asciidoc.go index c32fed8..7aa3bbc 100644 --- a/internal/core/changelog/format_asciidoc.go +++ b/internal/core/changelog/format_asciidoc.go @@ -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 ---