28 lines
598 B
Go
28 lines
598 B
Go
package makecmd
|
|
|
|
import (
|
|
"github.com/spf13/cobra"
|
|
"yizhisec.com/hsv2/forge/internal/controller/maker"
|
|
"yizhisec.com/hsv2/forge/internal/opt"
|
|
)
|
|
|
|
func Yosguard() *cobra.Command {
|
|
var (
|
|
_pkg bool // make yosguard upgrade pkg
|
|
)
|
|
|
|
_cmd := &cobra.Command{
|
|
Use: "yosguard",
|
|
Aliases: []string{"YOS"},
|
|
Short: "Make Yosguard",
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
|
mk := maker.NewMaker(opt.Cfg.Make.Dir)
|
|
return mk.Yosguard(cmd.Context(), maker.WithYosguardPkg(_pkg))
|
|
},
|
|
}
|
|
|
|
_cmd.Flags().BoolVar(&_pkg, "pkg", false, "make yosguard upgrade pkg")
|
|
|
|
return _cmd
|
|
}
|