|
|
|
@ -9,11 +9,11 @@ import (
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// Upgrade gets the latest goctl by
|
|
|
|
|
// go get -u github.com/tal-tech/go-zero/tools/goctl
|
|
|
|
|
// go install github.com/tal-tech/go-zero/tools/goctl@latest
|
|
|
|
|
func Upgrade(_ *cli.Context) error {
|
|
|
|
|
cmd := `GO111MODULE=on GOPROXY=https://goproxy.cn/,direct go install github.com/tal-tech/go-zero/tools/goctl@cli`
|
|
|
|
|
cmd := `GO111MODULE=on GOPROXY=https://goproxy.cn/,direct go install github.com/tal-tech/go-zero/tools/goctl@latest`
|
|
|
|
|
if runtime.GOOS == "windows" {
|
|
|
|
|
cmd = `set GOPROXY=https://goproxy.cn,direct && go install github.com/tal-tech/go-zero/tools/goctl@cli`
|
|
|
|
|
cmd = `set GOPROXY=https://goproxy.cn,direct && go install github.com/tal-tech/go-zero/tools/goctl@latest`
|
|
|
|
|
}
|
|
|
|
|
info, err := execx.Run(cmd, "")
|
|
|
|
|
if err != nil {
|
|
|
|
|