Fetch the repository succeeded.
package dep
import (
"fmt"
"gitee.com/mosache/YFrame/tools/Y/utils/cobraErr"
"github.com/logrusorgru/aurora"
"github.com/spf13/cobra"
"os"
"os/exec"
)
var depUpGradeCmd = &cobra.Command{Use: "upgrade",
Short: "upgrade dep",
Long: `upgrade dep Y dep`,
Args: cobra.ExactArgs(0),
Run: func(cmd *cobra.Command, args []string) {
if err := depUpGrade(); err != nil {
cobraErr.Err(cmd, err.Error())
}
},
}
func depUpGrade() error {
os.Setenv("GOPRIVATE", "gitee.com/mosache")
os.Setenv("GOPROXY", "https://goproxy.cn,direct")
/// YFrame
if err := exec.Command("go", "install", "gitee.com/mosache/YFrame/tools/Y@master").Run(); err != nil {
return err
}
fmt.Println(aurora.Green(fmt.Sprintf("upgrade YFrame success...")))
/// go-ctl
if err := exec.Command("go", "install", "github.com/zeromicro/go-zero/tools/goctl@latest").Run(); err != nil {
return err
}
fmt.Println(aurora.Green(fmt.Sprintf("upgrade go-ctl success...")))
/// go-task
if err := exec.Command("go", "install", "github.com/go-task/task/v3/cmd/task@latest").Run(); err != nil {
return err
}
fmt.Println(aurora.Green(fmt.Sprintf("upgrade go-task success...")))
return nil
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。