feat: 新增安装脚本

This commit is contained in:
yarnom 2025-10-14 13:26:09 +08:00
parent 229bbe76e8
commit 0fd915a2ee

View File

@ -32,7 +32,8 @@ func main() {
for _, svc := range serviceDirs { for _, svc := range serviceDirs {
out := filepath.Join(binDir, svc) out := filepath.Join(binDir, svc)
pkg := filepath.ToSlash(filepath.Join("./cmd", svc)) // 必须使用相对前缀 ./,否则 go 会将其当成标准库/模块路径
pkg := "./" + filepath.ToSlash(filepath.Join("cmd", svc))
fmt.Printf("编译 %s -> %s\n", pkg, out) fmt.Printf("编译 %s -> %s\n", pkg, out)
if err := run("go", "build", "-o", out, pkg); err != nil { if err := run("go", "build", "-o", out, pkg); err != nil {
fatalf("编译失败 %s: %v", pkg, err) fatalf("编译失败 %s: %v", pkg, err)