Properly list all installed packages, and ignore blacklisted ones

This commit is contained in:
SinTan1729 2023-02-24 16:12:39 -06:00
parent 0fe10af2c9
commit 37cb88981e
1 changed files with 6 additions and 1 deletions

View File

@ -26,6 +26,7 @@ import (
"go.arsenm.dev/lure/internal/db"
"go.arsenm.dev/lure/internal/repos"
"go.arsenm.dev/lure/manager"
"golang.org/x/exp/slices"
)
func listCmd(c *cli.Context) error {
@ -67,11 +68,15 @@ func listCmd(c *cli.Context) error {
return err
}
if slices.Contains(cfg.IgnorePkgUpdates, pkg.Name) {
continue
}
version := pkg.Version
if c.Bool("installed") {
instVersion, ok := installed[pkg.Name]
if !ok {
return nil
continue
} else {
version = instVersion
}