wip: 重新整理 install cmd
This commit is contained in:
@@ -9,22 +9,24 @@ func Prepare() *cobra.Command {
|
||||
|
||||
var (
|
||||
workdir string
|
||||
target string
|
||||
)
|
||||
|
||||
_cmd := &cobra.Command{
|
||||
Use: "prepare",
|
||||
Short: "Prepare for installation",
|
||||
Long: "Prepare for installation",
|
||||
PreRunE: func(cmd *cobra.Command, args []string) error {
|
||||
i := installer.NewInstaller(workdir)
|
||||
return i.CheckOK(cmd.Context())
|
||||
},
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
_installer := installer.NewInstaller(workdir, target)
|
||||
_installer := installer.NewInstaller(workdir)
|
||||
_installer.Prepare(cmd.Context())
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
||||
_cmd.Flags().StringVar(&workdir, "workdir", "/root/hs-installation", "Working directory")
|
||||
_cmd.Flags().StringVar(&target, "target", "self", "Target")
|
||||
|
||||
return _cmd
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user