gpm/cmd/list.go

28 lines
432 B
Go

package cmd
import (
"go.jolheiser.com/gpm/config"
"github.com/urfave/cli/v2"
"go.jolheiser.com/beaver"
)
var List = cli.Command{
Name: "list",
Aliases: []string{"l"},
Usage: "List local packages",
Action: doList,
}
func doList(_ *cli.Context) error {
cfg, err := config.Load()
if err != nil {
return err
}
for _, pkg := range cfg.Packages {
beaver.Infof("%s -> %s", pkg.Name, pkg.Import)
}
return nil
}