mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-07 08:12:41 +08:00
change: remove hrp har2case, replace with hrp convert
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
# Release History
|
||||
|
||||
## v4.1.2 (2022-06-03)
|
||||
## v4.1.2 (2022-06-05)
|
||||
|
||||
- fix #1331: use `str_eq` to assert string and digit equality
|
||||
- fix #1336: extract package with tar in Windows
|
||||
- fix: install package on MinGW64
|
||||
- change: remove `hrp har2case`, replace with `hrp convert`
|
||||
|
||||
## v4.1.1 (2022-05-31)
|
||||
|
||||
|
||||
@@ -57,5 +57,5 @@ func init() {
|
||||
convertCmd.Flags().BoolVar(&toJSONFlag, "to-json", false, "convert to JSON scripts (default)")
|
||||
convertCmd.Flags().BoolVar(&toYAMLFlag, "to-yaml", false, "convert to YAML scripts")
|
||||
convertCmd.Flags().StringVarP(&outputDir, "output-dir", "d", "", "specify output directory, default to the same dir with har file")
|
||||
convertCmd.Flags().StringVarP(&profilePath, "profile", "p", "", "specify profile path to override headers (except for auto-generated headers) and cookies")
|
||||
convertCmd.Flags().StringVarP(&profilePath, "profile", "p", "", "specify profile path to override headers and cookies")
|
||||
}
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/httprunner/httprunner/v4/hrp/internal/convert"
|
||||
)
|
||||
|
||||
// har2caseCmd represents the har2case command
|
||||
var har2caseCmd = &cobra.Command{
|
||||
Use: "har2case $har_path...",
|
||||
Short: "convert HAR to json/yaml testcase files",
|
||||
Long: `convert HAR to json/yaml testcase files`,
|
||||
Args: cobra.MinimumNArgs(1),
|
||||
PreRun: func(cmd *cobra.Command, args []string) {
|
||||
setLogLevel(logLevel)
|
||||
},
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
var flagCount int
|
||||
var har2caseOutputType convert.OutputType
|
||||
if har2caseGenJSONFlag {
|
||||
flagCount++
|
||||
}
|
||||
if har2caseGenYAMLFlag {
|
||||
flagCount++
|
||||
har2caseOutputType = convert.OutputTypeYAML
|
||||
}
|
||||
if flagCount > 1 {
|
||||
return errors.New("please specify at most one conversion flag")
|
||||
}
|
||||
convert.Run(har2caseOutputType, har2caseOutputDir, har2caseProfilePath, args)
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
||||
var (
|
||||
har2caseGenJSONFlag bool
|
||||
har2caseGenYAMLFlag bool
|
||||
har2caseOutputDir string
|
||||
har2caseProfilePath string
|
||||
)
|
||||
|
||||
func init() {
|
||||
rootCmd.AddCommand(har2caseCmd)
|
||||
har2caseCmd.Flags().BoolVarP(&har2caseGenJSONFlag, "to-json", "j", false, "convert to JSON format (default)")
|
||||
har2caseCmd.Flags().BoolVarP(&har2caseGenYAMLFlag, "to-yaml", "y", false, "convert to YAML format")
|
||||
har2caseCmd.Flags().StringVarP(&har2caseOutputDir, "output-dir", "d", "", "specify output directory, default to the same dir with har file")
|
||||
har2caseCmd.Flags().StringVarP(&har2caseProfilePath, "profile", "p", "", "specify profile path to override headers and cookies")
|
||||
}
|
||||
Reference in New Issue
Block a user