gpm/cmd/export.go

31 lines
400 B
Go

package cmd
import (
"fmt"
"go.jolheiser.com/gpm/config"
"github.com/urfave/cli/v2"
)
var Export = cli.Command{
Name: "export",
Usage: "Export JSON for local packages",
Action: doExport,
}
func doExport(_ *cli.Context) error {
cfg, err := config.Load()
if err != nil {
return err
}
export, err := cfg.Export()
if err != nil {
return err
}
fmt.Println(export)
return nil
}