2 Star 1 Fork 1

mosache/YFrame

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
grade.go 1.15 KB
一键复制 编辑 原始数据 按行查看 历史
ヤ沒脩袮兲︶ 提交于 2023-08-21 14:08 . add Y dep grade
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
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/mosache/YFrame.git
git@gitee.com:mosache/YFrame.git
mosache
YFrame
YFrame
v0.1.101

搜索帮助

0d507c66 1850385 C8b1a773 1850385