Skip to content

Commit

Permalink
fix(component): List installed version instead of latest
Browse files Browse the repository at this point in the history
Signed-off-by: Salim Afiune Maya <[email protected]>
  • Loading branch information
afiune committed Nov 7, 2023
1 parent 554f974 commit d92b2af
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion cli/cmd/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -808,10 +808,19 @@ func componentsToTable() [][]string {
colorize = color.New(color.FgYellow, color.Bold)
}

// by default, we display the latest version
version := cdata.LatestVersion.String()

// but if the component is installed,
// we display the current version instead
if currentVersion, err := cdata.CurrentVersion(); err == nil {
version = currentVersion.String()
}

out = append(out, []string{
colorize.Sprintf(cdata.Status().String()),
cdata.Name,
cdata.LatestVersion.String(),
version,
cdata.Description,
})
}
Expand Down

0 comments on commit d92b2af

Please sign in to comment.