29 lines
569 B
Go
29 lines
569 B
Go
package makecmd
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/spf13/cobra"
|
|
"yizhisec.com/hsv2/forge/internal/controller/maker"
|
|
"yizhisec.com/hsv2/forge/internal/opt"
|
|
)
|
|
|
|
func Registry() *cobra.Command {
|
|
var (
|
|
size int
|
|
)
|
|
|
|
_cmd := &cobra.Command{
|
|
Use: "registry",
|
|
Short: "Make registry dependency",
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
|
mk := maker.NewMaker(opt.Cfg.Make.Dir)
|
|
return mk.Registry(cmd.Context(), fmt.Sprintf("%dGi", size))
|
|
},
|
|
}
|
|
|
|
_cmd.Flags().IntVar(&size, "storage-size", 50, "Redis 存储大小(单位Gi)如: 100")
|
|
|
|
return _cmd
|
|
}
|