feat: add --output command in hrp build

This commit is contained in:
xucong053
2022-05-26 21:26:48 +08:00
parent 8fd093bdcc
commit c08861c9ca
6 changed files with 79 additions and 91 deletions

View File

@@ -12,15 +12,19 @@ var buildCmd = &cobra.Command{
Long: `build python/go plugin for testing`,
Example: ` $ hrp build plugin/debugtalk.go
$ hrp build plugin/debugtalk.py`,
Args: cobra.MinimumNArgs(1),
Args: cobra.ExactArgs(1),
PreRun: func(cmd *cobra.Command, args []string) {
setLogLevel(logLevel)
},
RunE: func(cmd *cobra.Command, args []string) error {
return build.Run(args)
return build.Run(args[0], output)
},
}
var output string
func init() {
rootCmd.AddCommand(buildCmd)
buildCmd.Flags().StringVarP(&output, "output", "o", "", "funplugin product output path, default: cwd")
}