mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-12 02:21:29 +08:00
29 lines
507 B
Go
29 lines
507 B
Go
package cmd
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
"github.com/httprunner/hrp/internal/builtin"
|
|
)
|
|
|
|
var scaffoldCmd = &cobra.Command{
|
|
Use: "startproject $project_name",
|
|
Short: "Create a scaffold project",
|
|
Args: cobra.ExactValidArgs(1),
|
|
PreRun: func(cmd *cobra.Command, args []string) {
|
|
setLogLevel(logLevel)
|
|
},
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
err := builtin.CreateScaffold(args[0])
|
|
if err != nil {
|
|
os.Exit(1)
|
|
}
|
|
},
|
|
}
|
|
|
|
func init() {
|
|
RootCmd.AddCommand(scaffoldCmd)
|
|
}
|