Compare commits
2 Commits
40cf0da2c0
...
a106100312
Author | SHA1 | Date | |
---|---|---|---|
a106100312 | |||
df72d95ab7 |
10
list.go
10
list.go
@ -49,7 +49,7 @@ func listCmd(c *cli.Context) error {
|
||||
log.Fatal("Unable to detect supported package manager on system").Send()
|
||||
}
|
||||
|
||||
installed, err = mgr.ListInstalled(nil)
|
||||
installed, err = mgr.ListInstalled(&manager.Opts{AsRoot: false})
|
||||
if err != nil {
|
||||
log.Fatal("Error listing installed packages").Err(err).Send()
|
||||
}
|
||||
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user