refactor: 整理结构和 maker 构建方式
This commit is contained in:
@@ -3,6 +3,7 @@ package makecmd
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
"yizhisec.com/hsv2/forge/internal/controller/maker"
|
||||
"yizhisec.com/hsv2/forge/internal/opt"
|
||||
)
|
||||
|
||||
func App() *cobra.Command {
|
||||
@@ -32,7 +33,7 @@ func appUser() *cobra.Command {
|
||||
Use: "user",
|
||||
Short: "Make User App",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
mk := maker.NewMaker()
|
||||
mk := maker.NewMaker(opt.Cfg.Make.Dir)
|
||||
return mk.AppUser(cmd.Context(), replica)
|
||||
},
|
||||
}
|
||||
@@ -51,7 +52,7 @@ func appClient() *cobra.Command {
|
||||
Use: "client",
|
||||
Short: "Make Client App",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
mk := maker.NewMaker()
|
||||
mk := maker.NewMaker(opt.Cfg.Make.Dir)
|
||||
return mk.AppClient(cmd.Context(), replica)
|
||||
},
|
||||
}
|
||||
@@ -70,7 +71,7 @@ func appGateway() *cobra.Command {
|
||||
Use: "gateway",
|
||||
Short: "Make Gateway App",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
mk := maker.NewMaker()
|
||||
mk := maker.NewMaker(opt.Cfg.Make.Dir)
|
||||
return mk.AppGateway(cmd.Context(), replica)
|
||||
},
|
||||
}
|
||||
@@ -89,7 +90,7 @@ func appMie() *cobra.Command {
|
||||
Use: "mie",
|
||||
Short: "Make Mie App",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
mk := maker.NewMaker()
|
||||
mk := maker.NewMaker(opt.Cfg.Make.Dir)
|
||||
return mk.AppMie(cmd.Context(), replica)
|
||||
},
|
||||
}
|
||||
@@ -109,7 +110,7 @@ func appOEM() *cobra.Command {
|
||||
Use: "oem",
|
||||
Short: "Make OEM App",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
mk := maker.NewMaker()
|
||||
mk := maker.NewMaker(opt.Cfg.Make.Dir)
|
||||
return mk.AppOEM(cmd.Context(), replica, vendor)
|
||||
},
|
||||
}
|
||||
@@ -136,7 +137,7 @@ func appNginx() *cobra.Command {
|
||||
if disableSeafile {
|
||||
opts = append(opts, maker.WithoutNginxSeafile())
|
||||
}
|
||||
mk := maker.NewMaker()
|
||||
mk := maker.NewMaker(opt.Cfg.Make.Dir)
|
||||
return mk.AppNginx(cmd.Context(), opts...)
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user