Show version of installed package when listing installed packages
ci/woodpecker/push/woodpecker Pipeline was successful Details

This commit is contained in:
Arsen Musayelyan 2022-12-01 00:14:07 -08:00
parent df72d95ab7
commit a106100312
1 changed files with 6 additions and 2 deletions

View File

@ -62,13 +62,17 @@ func listCmd(c *cli.Context) error {
return err
}
version := pkg.Version
if c.Bool("installed") {
if _, ok := installed[pkg.Name]; !ok {
instVersion, ok := installed[pkg.Name]
if !ok {
return nil
} else {
version = instVersion
}
}
fmt.Printf("%s/%s %s\n", pkg.Repository, pkg.Name, pkg.Version)
fmt.Printf("%s/%s %s\n", pkg.Repository, pkg.Name, version)
return nil
})
if err != nil {