新增cursor的配置

This commit is contained in:
zeaslity
2025-02-25 17:01:14 +08:00
parent 5a8aa53d64
commit 60a1849207
70 changed files with 60241 additions and 17631 deletions

View File

@@ -4,7 +4,9 @@ import (
"agent-wdd/config"
"agent-wdd/log"
"agent-wdd/op"
"agent-wdd/utils"
"fmt"
"github.com/spf13/cobra"
)
@@ -15,6 +17,8 @@ var (
centosCommonTools = []string{
"deltarpm", "net-tools", "iputils", "bind-utils", "lsof", "curl", "wget", "vim", "mtr", "htop",
}
dockerLocalInstallPath = "/root/wdd/docker-20.10.15.tgz" // 本地安装docker的文件路径
)
// 添加base子命令
@@ -77,7 +81,22 @@ func addDockerSubcommands(cmd *cobra.Command) {
Short: "网络安装Docker",
Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
fmt.Printf("Installing Docker version: %s\n", args[0])
// 检查参数
if len(args) > 0 {
fmt.Printf("Installing Docker version: %s\n", args[0])
}
// 没有传递参数,使用默认参数
version := "26.0.7"
log.Info("Installing Docker version: %s", version)
// 安装docker
packOperator := op.AgentPackOperator
packOperator.PackageInit()
// ubuntu 和 centos的安装命令是不是一样的
packOperator.Install([]string{"docker-ce", "docker-ce-cli", "containerd.io", "docker-buildx-plugin", "docker-compose-plugin"})
},
}
@@ -94,7 +113,14 @@ func addDockerSubcommands(cmd *cobra.Command) {
Short: "本地安装Docker",
Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
fmt.Printf("Installing Docker from: %s\n", args[0])
exist := utils.FileExistAndNotNull(dockerLocalInstallPath)
if !exist {
log.Error("Docker local install file not found: %s", dockerLocalInstallPath)
return
}
// 解压文件
utils.Unzip(dockerLocalInstallPath, "/root/wdd")
},
}