2020-02-19 05:18:36 +00:00
|
|
|
package cmd
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
2020-10-07 04:11:36 +00:00
|
|
|
|
|
|
|
"go.jolheiser.com/gpm/config"
|
|
|
|
|
2020-02-19 05:18:36 +00:00
|
|
|
"github.com/urfave/cli/v2"
|
|
|
|
)
|
|
|
|
|
|
|
|
var Export = cli.Command{
|
|
|
|
Name: "export",
|
2020-02-19 16:48:55 +00:00
|
|
|
Usage: "Export JSON for local packages",
|
2020-02-19 05:18:36 +00:00
|
|
|
Action: doExport,
|
|
|
|
}
|
|
|
|
|
2020-10-07 04:11:36 +00:00
|
|
|
func doExport(_ *cli.Context) error {
|
|
|
|
cfg, err := config.Load()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2020-02-19 05:18:36 +00:00
|
|
|
|
2020-10-07 04:11:36 +00:00
|
|
|
export, err := cfg.Export()
|
2020-02-19 05:18:36 +00:00
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
2020-02-19 05:39:54 +00:00
|
|
|
fmt.Println(export)
|
2020-02-19 05:18:36 +00:00
|
|
|
return nil
|
|
|
|
}
|