From 853a456b1240b8a7fa2ea2d2698dd1c2344af3fb Mon Sep 17 00:00:00 2001 From: debugtalk Date: Sat, 8 Jan 2022 22:21:42 +0800 Subject: [PATCH] change: udpate docs --- README.md | 11 ++++++----- cli/hrp/cmd/har2case.go | 4 ++-- cli/hrp/cmd/scaffold.go | 2 +- internal/scaffold/main.go | 3 ++- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index e1daa8a5..6ddd349c 100644 --- a/README.md +++ b/README.md @@ -62,11 +62,12 @@ Usage: hrp [command] Available Commands: - boom run load test with boomer - completion generate the autocompletion script for the specified shell - har2case Convert HAR to json/yaml testcase files - help Help about any command - run run API test + boom run load test with boomer + completion generate the autocompletion script for the specified shell + har2case convert HAR to json/yaml testcase files + help Help about any command + run run API test + startproject create a scaffold project Flags: -h, --help help for hrp diff --git a/cli/hrp/cmd/har2case.go b/cli/hrp/cmd/har2case.go index 4e08ea41..c59ac313 100644 --- a/cli/hrp/cmd/har2case.go +++ b/cli/hrp/cmd/har2case.go @@ -10,8 +10,8 @@ import ( // 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`, + 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) diff --git a/cli/hrp/cmd/scaffold.go b/cli/hrp/cmd/scaffold.go index 94c4fd51..36a78f37 100644 --- a/cli/hrp/cmd/scaffold.go +++ b/cli/hrp/cmd/scaffold.go @@ -10,7 +10,7 @@ import ( var scaffoldCmd = &cobra.Command{ Use: "startproject $project_name", - Short: "Create a scaffold project", + Short: "create a scaffold project", Args: cobra.ExactValidArgs(1), PreRun: func(cmd *cobra.Command, args []string) { setLogLevel(logLevel) diff --git a/internal/scaffold/main.go b/internal/scaffold/main.go index 32838335..2f2b7528 100644 --- a/internal/scaffold/main.go +++ b/internal/scaffold/main.go @@ -2,6 +2,7 @@ package scaffold import ( "fmt" + "io/ioutil" "os" "path" @@ -62,7 +63,7 @@ func createFolder(folderPath string) error { func createFile(filePath string, data string) error { log.Info().Str("filePath", filePath).Msg("create file") - err := os.WriteFile(filePath, []byte(data), 0o644) + err := ioutil.WriteFile(filePath, []byte(data), 0o644) if err != nil { log.Error().Err(err).Msg("create file failed") return err