Skip to content

Commit

Permalink
Merge pull request #1 from jakewarren/fixup-codename
Browse files Browse the repository at this point in the history
update to latest JSON schema
  • Loading branch information
kobayashi authored Jul 6, 2023
2 parents c47385a + 222c648 commit 1d2794f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
4 changes: 2 additions & 2 deletions pkg/api/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ type ProjectList []string
// Cycle is for specific project cycle
type Cycle struct {
Cycle StringOrInt `json:"cycle"`
Release *string `json:"release"`
ReleaseDate *string `json:"releaseDate"`
EOL StringOrBool `json:"eol"`
Latest *string `json:"latest"`
Link *string `json:"link,omitempty"`
LTS *bool `json:"lts,omitempty"`
Support StringOrBool `json:"support,omitempty"`
CycleShortHand StringOrInt `json:"cycleShortHand"`
CycleShortHand StringOrInt `json:"codename"`
Discontinued StringOrBool `json:"disconitinued"`
}

Expand Down
25 changes: 20 additions & 5 deletions pkg/commands/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,21 @@ func createContentList(cycles api.CycleList) (*tableContenet, error) {
}
row = append(row, *p.Cycle.I)
}
if p.CycleShortHand.S != nil {
h := "Codename"
exist := header.isHeaderExist(h)
if !exist {
header.Row = append(header.Row, h)
}
row = append(row, *p.CycleShortHand.S)
} else if p.CycleShortHand.I != nil {
h := "Codename"
exist := header.isHeaderExist(h)
if !exist {
header.Row = append(header.Row, h)
}
row = append(row, *p.CycleShortHand.I)
}
if p.EOL.S != nil {
eol, err := setColorDate(*p.EOL.S)
if err != nil {
Expand All @@ -128,13 +143,13 @@ func createContentList(cycles api.CycleList) (*tableContenet, error) {
}
row = append(row, eol)
}
if p.Release != nil {
h := "Release"
if p.ReleaseDate != nil {
h := "Release Date"
exist := header.isHeaderExist(h)
if !exist {
header.Row = append(header.Row, h)
}
row = append(row, *p.Release)
row = append(row, *p.ReleaseDate)
}
if p.Support.S != nil {
h := "Support"
Expand Down Expand Up @@ -191,9 +206,9 @@ func createContent(cycle *api.Cycle) (*tableContenet, error) {
header = append(header, "#")
row = append(row, *cycle.Cycle.I)
}
if cycle.Release != nil {
if cycle.ReleaseDate != nil {
header = append(header, "Release")
row = append(row, *cycle.Release)
row = append(row, *cycle.ReleaseDate)
}
if cycle.EOL.S != nil {
eol, err := setColorDate(*cycle.EOL.S)
Expand Down

0 comments on commit 1d2794f

Please sign in to comment.