style:change (#2022)

pull/2032/head
songzhibin97 3 years ago committed by GitHub
parent ec2e3ab24e
commit aa6529fb2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      cmd/kratos/internal/change/change.go
  2. 5
      cmd/kratos/internal/change/get.go

@ -38,8 +38,8 @@ func run(cmd *cobra.Command, args []string) {
if version == "dev" { if version == "dev" {
info := api.GetCommitsInfo() info := api.GetCommitsInfo()
fmt.Print(ParseCommitsInfo(info)) fmt.Print(ParseCommitsInfo(info))
} else { return
}
info := api.GetReleaseInfo(version) info := api.GetReleaseInfo(version)
fmt.Print(ParseReleaseInfo(info)) fmt.Print(ParseReleaseInfo(info))
} }
}

@ -157,13 +157,14 @@ func ParseCommitsInfo(info []CommitInfo) string {
case "other": case "other":
text = "### Others\n" text = "### Others\n"
} }
if len(value) > 0 { if len(value) == 0 {
continue
}
md[key] += text md[key] += text
for _, value := range value { for _, value := range value {
md[key] += fmt.Sprintf("- %s\n", value) md[key] += fmt.Sprintf("- %s\n", value)
} }
} }
}
return fmt.Sprint(md["break"], md["deps"], md["feat"], md["fix"], md["chore"], md["other"]) return fmt.Sprint(md["break"], md["deps"], md["feat"], md["fix"], md["chore"], md["other"])
} }

Loading…
Cancel
Save