26 lines
378 B
Go
26 lines
378 B
Go
package cmd
|
|
|
|
import (
|
|
"encoding/json"
|
|
"fmt"
|
|
"gitea.com/gpm/cli/modules/config"
|
|
"github.com/urfave/cli/v2"
|
|
)
|
|
|
|
var Export = cli.Command{
|
|
Name: "export",
|
|
Usage: "Export local gpm packages",
|
|
Action: doExport,
|
|
}
|
|
|
|
func doExport(ctx *cli.Context) error {
|
|
|
|
data, err := json.Marshal(config.Packages)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
fmt.Println(string(data))
|
|
return nil
|
|
}
|