hertz_scaffold/cmd/cmd.go
yuxh 7d115fe172 build: 更新模板 URL 为 HTTPS 方式
- 将模板 URL 从 SSH 形式改为 HTTPS 形式
- 适应远程仓库地址变更,确保代码克隆和更新正常进行
2025-05-11 23:56:37 +08:00

41 lines
673 B
Go

package cmd
import (
"fmt"
"github.com/spf13/cobra"
"log"
"os"
)
var (
template = "https://golib.gaore.com/GaoreGo/hertz_demo.git"
project string
branch string
)
var rootCmd = &cobra.Command{
Use: "hertz_scaffold",
Short: "hertz框架脚手架",
Long: `以golib.gaore.com/GaoreGo/hertz_demo为模板的脚手架`,
Run: func(cmd *cobra.Command, args []string) {
if len(args) == 0 {
cmd.Help()
} else {
fmt.Println("Invalid command")
}
},
}
// Execute 执行命令
func Execute() {
if err := rootCmd.Execute(); err != nil {
log.Println(err)
os.Exit(1)
}
}
func init() {
rootCmd.AddCommand(createCmd)
rootCmd.AddCommand(updateCmd)
}