feat: add build command for plugin

This commit is contained in:
xucong053
2022-05-20 16:53:09 +08:00
parent dc68923aa0
commit 8fd093bdcc
7 changed files with 499 additions and 0 deletions

26
hrp/cmd/build.go Normal file
View File

@@ -0,0 +1,26 @@
package cmd
import (
"github.com/spf13/cobra"
"github.com/httprunner/httprunner/v4/hrp/internal/build"
)
var buildCmd = &cobra.Command{
Use: "build $path ...",
Short: "build plugin for testing",
Long: `build python/go plugin for testing`,
Example: ` $ hrp build plugin/debugtalk.go
$ hrp build plugin/debugtalk.py`,
Args: cobra.MinimumNArgs(1),
PreRun: func(cmd *cobra.Command, args []string) {
setLogLevel(logLevel)
},
RunE: func(cmd *cobra.Command, args []string) error {
return build.Run(args)
},
}
func init() {
rootCmd.AddCommand(buildCmd)
}