Skip to content

Commit

Permalink
chore: update name
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Phillips <[email protected]>
  • Loading branch information
spiffcs committed Jan 24, 2024
1 parent 42a022a commit 91edfac
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions cmd/grant/cli/internal/list/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,21 +116,24 @@ func (r *Report) renderList() error {
for _, c := range r.Cases {
r.Monitor.Increment()
r.Monitor.AtomicStage.Set(c.UserInput)
sortMe := make([]string, 0)
unsortedLicenses := make([]string, 0)
resultList := list.NewWriter()
uiLists = append(uiLists, resultList)
resultList.AppendItem(color.Primary.Sprintf("%s", c.UserInput))
_, licenses, _ := c.GetLicenses()
for _, license := range licenses {
if license.IsSPDX() {
sortMe = append(sortMe, license.SPDXExpression)
unsortedLicenses = append(unsortedLicenses, license.SPDXExpression)
continue
}
sortMe = append(sortMe, license.Name)
unsortedLicenses = append(unsortedLicenses, license.Name)
}
slices.Sort(sortMe)

// sort for list output
slices.Sort(unsortedLicenses)

resultList.Indent()
for _, license := range sortMe {
for _, license := range unsortedLicenses {
resultList.AppendItem(license)
}
resultList.UnIndent()
Expand Down

0 comments on commit 91edfac

Please sign in to comment.