chore(go): route release notes through vociferate

This commit is contained in:
Micheal Wilkinson
2026-03-21 14:33:53 +00:00
parent 9dc28e8229
commit 92f76fd19f
5 changed files with 198 additions and 16 deletions

View File

@@ -14,6 +14,7 @@ func main() {
date := flag.String("date", "", "release date in YYYY-MM-DD format")
recommend := flag.Bool("recommend", false, "print the recommended next release tag based on the changelog")
printUnreleased := flag.Bool("print-unreleased", false, "print the current Unreleased changelog body")
printReleaseNotes := flag.Bool("print-release-notes", false, "print the release notes section for --version")
root := flag.String("root", ".", "repository root to update")
versionFile := flag.String("version-file", "", "path to the version file, relative to --root")
versionPattern := flag.String("version-pattern", "", "regexp with one capture group for the version value")
@@ -52,8 +53,18 @@ func main() {
return
}
if *printReleaseNotes {
body, err := vociferate.ReleaseNotes(absRoot, *version, opts)
if err != nil {
fmt.Fprintf(os.Stderr, "print release notes: %v\n", err)
os.Exit(1)
}
fmt.Print(body)
return
}
if *version == "" || *date == "" {
fmt.Fprintln(os.Stderr, "usage: vociferate --version <version> --date <YYYY-MM-DD> [--root <dir>] [--version-file <path>] [--version-pattern <regexp>] [--changelog <path>] | --recommend [--root <dir>] [--version-file <path>] [--version-pattern <regexp>] [--changelog <path>] | --print-unreleased [--root <dir>] [--changelog <path>]")
fmt.Fprintln(os.Stderr, "usage: vociferate --version <version> --date <YYYY-MM-DD> [--root <dir>] [--version-file <path>] [--version-pattern <regexp>] [--changelog <path>] | --recommend [--root <dir>] [--version-file <path>] [--version-pattern <regexp>] [--changelog <path>] | --print-unreleased [--root <dir>] [--changelog <path>] | --print-release-notes --version <version> [--root <dir>] [--changelog <path>]")
os.Exit(2)
}